Posting JSON to Sinatra using curl

Because of the difficulties (opacity) of trying to develop unit tests with Rack on a Sinatra application, I decided to try get something working with curl: we have much better control of the post process and is something we can actually troubleshoot.

Of all the posts I have seen regarding to Rack applications, the one that sticks with me is http://lightyearsoftware.com/2013/02/sending-json-post-data-in-an-integration-test http://lightyearsoftware.com/2013/02/sending-json-post-data-in-an-integration-test/, simply because the author says that it is not straightforward and doesn’t expect it to continue working with future versions of Ruby or Rails.

I’ll put together another post shortly describing in a bit more detail, not just the POSTing, but the receiving end as well. It’s been painful.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s