Sunday, 13 February 2011

HTTP STATUS CODES IN TWITTER

Status code is a series of information returned to client in HTTP request.  It is a series of three digit number used to communicate the type of success or failure encountered after making a request. The twitter API assigns special meaning to this code which describe specific outcome of method request.
Examples of codes:
200—OK
Success! The method request did what you expected it to do.
304—Not Modified
Nothing wrong, but nothing to report.
400—Bad Request
This can be caused by one of two things: either the request was formatted incorrectly
(missing required parameters, unknown method, etc.), or the rate limit has
been exceeded. Check the returned text for an explanation.
401—Not Authorized
The account (Twitter username or registered email address) or password you used
to authenticate to the API isn’t working. Check its accuracy and try again.
403—Forbidden
Twitter understood what you want to do, but won’t let you do it. Check the returned
text for an explanation.
404—Not Found
Probably caused by a typo or incorrect path to the API method you are requesting.
You might also get this error when trying to request a nonexistent user.
500—Internal Server Error

Status code helps in error handling.

No comments:

Post a Comment