问题
I am working on a program which share data to LinkedIn User’s Profile. I am using Delphi XE2, OAuth and LinkedIn API for the same. I am able to Access token. But I am getting error on when trying to. I am using OAuth for Delphi. For SSL I am using, TIdSSLIOHandlerSOcketOpenSSL with method sslvSSLv3. I am trying to post the following:
I am posting (https://api.linkedin.com/v1/people/~/shares)as Url and
('; hiSiranyone
) as Xml.
And my Idhttp Custom header*** ('oauth_consumer_key='+xxxxxxxxxxx+ ',oauth_signature_method="HMAC-SHA1"'+',oauth_timestamp='+QuotedStr(ARequest.GenerateTimeStamp)+ ',oauth_nonce='+QuotedStr(ARequest.GenerateNonce)+',oauth_version="1.0"'+ ',oauth_token='+xxxxxxxxxx+',oauth_signature='+QuotedStr(sign));
The result I am getting from Indy Http is this: Http/1.1 401 – Unauthorized Can anyone help me for fixing this? Please help....
回答1:
Look at this question and this article
IdSSLIOHandlerSocketOpenSSL := TIdSSLIOHandlerSocketOpenSSL.Create(nil);
with IdSSLIOHandlerSocketOpenSSL do begin
SSLOptions.Method := sslvSSLv3;
SSLOptions.SSLVersions := [sslvSSLv3];
SSLOptions.Mode := sslmBoth;
SSLOptions.VerifyMode := [];
SSLOptions.VerifyDepth := 0;
host := '';
end;
来源:https://stackoverflow.com/questions/10981160/share-data-to-linkedin-user-s-profile-for-status-update