Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The post for auth should accept 201 as a status code (not just 200). #17

Closed
idyll opened this issue Feb 16, 2012 · 3 comments
Closed

The post for auth should accept 201 as a status code (not just 200). #17

idyll opened this issue Feb 16, 2012 · 3 comments

Comments

@idyll
Copy link

idyll commented Feb 16, 2012

Since the call is a post and auth credentials are being created a 201 is more appropriate.

Many people abuse 200 so you probably need to look for both.

Ideally:

xhr.status == 200 || xhr.status == 201
@stof
Copy link
Contributor

stof commented Feb 24, 2015

The code should probably even accept any successful status code (i.e. any 2xx)

@pl
Copy link
Contributor

pl commented Feb 27, 2015

Heh, this issue really got lost. I will add 201 to supported codes in the next major release. IMHO, codes 202-206 don't look like appropriate responses to auth requests.

@pl
Copy link
Contributor

pl commented Feb 27, 2015

I had deeper look at RFC 2616 and 201 is not a correct response either:

The request has been fulfilled and resulted in a new resource being created. The newly created resource can be referenced by the URI(s) returned in the entity of the response, with the most specific URI for the resource given by a Location header field.

We're not really creating a resource in the auth call, so it can't be referenced later.

Sorry for the confusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants