0

How can i call Auth Authentication using Restfull

i want to send :

 Authorization: OAuth realm="Photos", oauth_consumer_key="dpf43f3p2l4k3l03", oauth_signature_method="HMAC-SHA1", oauth_timestamp="137131200", oauth_nonce="wIjqoS", oauth_callback="http%3A%2F%2Fprinter.example.com%2Fready", oauth_signature="74KNZJeDHnMBp0EMJ9ZHt%2FXKycU%3D" 

I dont khonw more about Auth. so please help.

2
  • 1
    Are you using HttpClient for communicating with server ? Commented Aug 29, 2013 at 11:16
  • yes i am using HttpClient.. Commented Aug 29, 2013 at 14:23

1 Answer 1

1

Since you are using HTTP client, it becomes very easy to send this header as a part of request. This can be accomplished as follows:

HttpGet request = new HttpGet("http://yoursite"); String authStr = "";// Your string starting from OAuth realm="Photos",oauth_consumer_key="dpf43f3p2l4k3l03" .... request.setHeader("Authorization", authStr ); 

Once you execute this request, a Authorization header is sent to the server.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.