[SalesForce] REST api not working through Firefox add-ons: HttpRequester/Poster

ok, this is bizarre, but I cannot for the life of me get the REST api to work through a tool like Firefox's Http Requester.

I am just doing a basic get call to:
https://cs1.salesforce.com/services/data/v20.0/

The only header I have is:

Authorization: Bearer access_token

The result I get is a browser login page with some text: "You have attempted to access a page that requires a salesforce.com login. If you are already a user of the system, please log in below."

Thing is, doing this through curl actually returns me the data I am looking for:

curl https://cs1.salesforce.com/services/data/v20.0/ -H 'Authorization: Bearer access_token' 

This happens with Firefox's Poster add-on as well. Anyone have any ideas?

Best Answer

Here is a link describing the REST API access from Firefox poster as below. Hope this will help.

1)https://login.salesforce.com/services/oauth2/token Use this first as a request URL to get access token .Please use test.salesforce.com for sandbox

2)To obtain access token you must Use POST http call: In the payload use

grant_type=password&client_id=&client_secret=&username=&password=

where client id,client secret you will get from your remote access settings and please append security token if you are making from unautorized IP range .Please use appropriate User Name and Password

3)Once you POST to the service you will get acess token .Please save that for future requests

4)Next in the header add following parameter and its value as Name:Authorization Value:Bearer +oauthtoken obtained (Bearer space and your oauth_token)

5)Now once you add header in request URL add your REST service URL in the request URL of Poster tool(eg:https://ap1.salesforce.com/services/apexrest/CaseManagement/v1/50090000004TBNU)

Source:- http://cloudyworlds.blogspot.in/2012/09/cloudy-using-poster-mozilla-tool-to-get.html