This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Sending http request Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply locked New topic
Author

Sending http request

shivang sarawagi
Ranch Hand

Joined: Jun 19, 2008
Posts: 147
Hi Friends,

I just need a little help. Kind of stranded don't know how to proceed. If you could please help me out.

I am developing a facebook application in java. For that I have to go through an authentication process for the app.

These are the steps

1.Create a Facebook Application

2. Request https://graph.facebook.com/oauth/authorize?client_id=MY_API_KEY& redirect_uri=http://www.facebook.com/connect/login_success.html&
scope=publish_stream,offline_access,create_event

3.Facebook will redirect you to http://www.facebook.com/connect/login_success.html? code=MY_VERIFICATION_CODE

4.Request https://graph.facebook.com/oauth/access_token?client_id=MY_API_KEY& redirect_uri=http://www.facebook.com/connect/login_success.html& client_secret=MY_APP_SECRET&code=MY_VERIFICATION_CODE

5.Facebook will respond with access_token=MY_ACCESS_TOKEN

For the second step I used response.sendRedirect(); and sent the request. But as per the third request when the facebook redirects me to a url its just a page with
success written in it. Now I don't know how to proceed with the 4th step. How do I extract the verification code and send the request again.

Can you please tell is there any way to send the request again, maintaining the flow of the app.

Thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60774
    
  65

Please do not post the same question more than once.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
Don't get me started about those stupid light bulbs.
 
subject: Sending http request
 
Similar Threads
[GoogleAPI] get user info
A 404 Error, need help configuring web.xml
Sending http request
Tomcat 6 : RequestParameter value gets cut off at hash (#) character
How to post a http POST request in java?.