get paid to paste

Sending authorized requests

Most sites like twitter,facebook, have exposed their API as RESTful webservices. 

[tpb]What do you need to access these APIs ?[/tpb]

A Http library like http://hc.apache.org/

And a parsing library depending upon the type of response (JSON / XML )

I liked http://jackson.codehaus.org/ for its "Simple Data Binding" explained here http://wiki.fasterxml.com/JacksonInFiveMinutes

[tpb]Can I send requests right away using a http library ?[/tpb]

It depends ! Some requests need to be authorized. Imagine unauthourized access to "POST" messages !

[tpb]How can I send authorized requests ?[/tpb]

The user first authorizes your app do some tasks. (like fetch some info / post some info )

User authorizing, (in terms of code) simply means that you are provided "tokens"

Then when you send a request, you'd sign the request with these tokens.

[tpb]What do I need to sign requests[/tpb]
A library like SignPost

Pasted: Jun 9, 2011, 10:16:21 am
Views: 18