Can someone please explain to me how to create an ASIHTTPRequest object that can post a stream to facebook using the Graph API?
The API call is: https://graph.facebook.com/me/feed?message=X&access_token=Y
The method type is POST
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’ve never posted directly to the Facebook Graph api (though I have used their API that pulls up UIWebView dialogs and handles the actual posting business for you). I’ve used the heck out of ASIHTTPRequest, though.
Couple things. I demonstrate the usage of the
.userInfofield because it’s just so darn useful. That property takes any NSDictionary containing any objects you want to include, and you can get to them later in the-request: didFinishmethod. You could pass it a pointer to the UIImageView image you want to load with the UIImage you’re downloading, for instance. More frequently, in my experience, if you have more than one request happening inside the same viewController, you just set a different object for your@"type"key in that dictionary, and you’ve got an easy way to tell them apart later.Second, you might well ask, “Do I have to do anything special because it’s https?” In my experience, you totally don’t, ASIHTTPRequest is smart enough to handle all that behind the scenes.
If you need to build up post fields, rather than just sending data on the query string, you use an ASIFormPostData object rather than ASIHTTPRequest, but it behaves more or less the same.
EDIT, SEVERAL YEARS LATER: ASIHttpRequest is now deprecated by its developer, who recommends shifting to a different package that is under current development. People seem to like AFNetworking.