cojohn / node-urban-airship

Simple wrapper for the Urban Airship API in Node.js.
MIT License
36 stars 15 forks source link

Trailing slash #3

Closed gwil closed 12 years ago

gwil commented 12 years ago

It should probably be noted that the /api/push/ endpoint requires the trailing /.

Just to save tracking down that 405 or 301 response.

cojohn commented 12 years ago

Is there a bum example? I ran into this issue when I was first experimenting with the API, but their stuff is pretty clearly doc'd.

I do plan to make some enhancements to the wrapper's API soon to prevent proliferation of hard-coded routes in code that implements the wrapper. That should help, yes?

gwil commented 12 years ago

Just referring to the example provided for the /api/push/ endpoint.

In the example, ua.pushNotification("/api/push", payload0, function(error) {....});, it returns a 301, documented by UA that it's likely because of the missing trailing slash. I'm not sure if the other endpoints are that strict; I've ran into the /api/push/ issue before, thought I'd point it out for others!

https://support.urbanairship.com/customer/portal/articles/60923-troubleshooting-http-status-codes

cojohn commented 12 years ago

This should be fixed with v0.2.2.