1

Is there some way to use Apiary to respond appropriately to JSONP requests?

request looks like:

http://myserver.apiary-mock.com/api/v1/startup/dashboard?callback=jQuery20008137053514365107_1400036479208&user_id=1&_=1400036479210

and I need the request to take that jQuery string and wrap it around the response (normal response body shown as {...} below):

jQuery20008137053514365107_1400036479208({...})

So, if the normal request was:

http://myserver.apiary-mock.com/api/v1/startup/dashboard

And the normal response was:

{ "yes": true }

Then, adding a callback like:

http://myserver.apiary-mock.com/api/v1/startup/dashboard?callback=bob

Would make the response look like:

bob({ "yes": true })
cmcculloh
  • 47,596
  • 40
  • 105
  • 130
  • hi, can you give use the call and the request that you want to perform? – jeorfevre Jun 07 '14 at 12:54
  • Not sure what you mean... I want to hit an Apiary route with that ?callback= on it and I want it to take the value of the callback parameter and wrap it around the response... I'll try and update my question to be more clear? – cmcculloh Jun 13 '14 at 19:37
  • http://jsfiddle.net/cmcculloh/M4Kt8/4/ – cmcculloh Jul 04 '14 at 02:53

1 Answers1

0

Apiary does not support this currently, but might be working on it.

cmcculloh
  • 47,596
  • 40
  • 105
  • 130