Road Closed

Can I use POST with the RESTful API??

Question

Last Updated: March 26, 2013

Hello! Love your API. After working with it I noticed that if I POST the address data and auth-token, I get a 401 authentication failure message. But if I send the same data using GET, it works just fine.

I also got a 401 authentication error when POSTing the address data and sending the "auth-token" as a header.

I'm going off the documentation that says you can POST or GET the data:

Making JSON requests

Answer

Did you remember to URL-encode your auth-token value? Also, are you executing the post from a web browser? If so, lots of browsers don't allow a cross-domain POST. You'll either need to execute the API call from one of your servers/machines or use GET (via JSONP).