Skip to main content

Posts

Showing posts from November, 2012

Basic Authorization with Coldfusion

When trying to access a webservice or a rest api you might need authorization, this can be done simply by sending the username and password throw the cfhttp as the below: The respond you might receive is as below: 200  - OK - Everything went fine. 400s - all caused by user interaction 400  - Bad Request - The request was malformed or the data supplied by the end user was not valid. This is also used if the user has exceeded their API usage limit. 401  - Unauthorized - The user is not authorized to access the requested resource. Additional information is typically supplied within the response to tell the end user (API consumer) how to authorize itself (ie. BASIC Authentication). 403  - Forbidden - The user has exceeded their post limit (not bloody likely). 404  - Not Found - The requested resource was not found. 405  - Method Not Allowed - The user attempted to use a verb (ex. GET, POST) on a resource that had no support for the given verb. 406  - Not Acceptable - The user