Open GoogleCodeExporter opened 9 years ago
Hey,
I am also looking for the Authorization header using this library. Is there any
docs how to use this library.
Thanks
Original comment by komal2...@gmail.com
on 29 Dec 2011 at 8:05
This worked for me...
public function postNetworkUpdate(accessToken:OAuthToken, update:String):void
{
// Construct XML request
var xmlPost:String = "<activity locale='en_US'>" +
"<content-type>linkedin-html</content-type>" +
"<body>" + StringUtil.trim(update) + "</body>" +
"</activity>"
// Creating new oauth request to get access token
var oauthRequest:OAuthRequest =
new OAuthRequest(
OAuthRequest.HTTP_MEHTOD_POST, "http://api.linkedin.com/v1/people/~/person-activities",
null, consumer, accessToken
);
// Creating new url request
var request:URLRequest = new URLRequest(oauthRequest.requestURL);
// Adding signed header with request parameters
request.requestHeaders.push(oauthRequest.buildRequest(signature, OAuthRequest.RESULT_TYPE_HEADER));
// The request method is POST
request.method = URLRequestMethod.POST;
// The request content type
request.contentType = "application/xml";
// Passing xml as POST data
request.data = xmlPost;
// Invoking remote service with URLLoader
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, postNetworkUpdate_completeHandler);
loader.addEventListener(IOErrorEvent.IO_ERROR, postNetworkUpdate_ioErrorHandler);
loader.load(request);
}
Hope it helps
Original comment by ticap...@gmail.com
on 29 Jan 2012 at 9:31
Yes, It worked. Thanks.
Original comment by sharma4r...@gmail.com
on 30 Jan 2012 at 9:09
Original issue reported on code.google.com by
sharma4r...@gmail.com
on 29 Dec 2011 at 6:12