English 中文(简体)
Error 401 with Linked 在APLANST中提出的要求
原标题:Error 401 with LinkedIn API POST requests

When try to POST a status update to LinkedIn, I got 401 Unauthorized error. I change Live Status in my LinkedIn app to Live but the problem s still there. I tried http://simplelinkedin.fiftymission.net/demo/ but I still get 401 error... Everything is fine with GET requests (get user profile data,...).

请求数据:

POST /v1/people/~/shares HTTP/1.1
Host: api.linkedin.com
Connection: close
User-Agent: CakePHP
content-type: application/x-www-form-urlencoded
x-li-format: json
Authorization: OAuth oauth_version="1.0",oauth_signature_method="HMAC-SHA1",oauth_consumer_key="2z82i0j5ahjb",oauth_token="2de47758-86e1-4684-afd3-f55a56051d2d",oauth_nonce="03aae214a19e83fe2757e8061a4b1468",oauth_timestamp="1326363432",oauth_signature="WNbKgq1FnkIgIALI%2FMfVnBHLgTg%3D"
Content-Length: 131

{"comment":"I am tesing CakePHP","content":{"title":"","submitted-url":"","submitted-image-url":""},"visibility":{"code":"anyone"}}

这里是答复数据:

HTTP/1.1 401 Unauthorized
Server: Apache-Coyote/1.1
Date: Thu, 12 Jan 2012 10:17:12 GMT
Vary: *
x-li-format: json
Content-Type: application/json;charset=UTF-8
Content-Length: 230

{
  "errorCode": 0,
  "message": "[unauthorized]. OAU:2z82i0j5ahjb|2de47758-86e1-4684-afd3-f55a56051d2d|*01|*01:1326363432:WNbKgq1FnkIgIALI/MfVnBHLgTg=",
  "requestId": "5XSUW613R2",
  "status": 401,
  "timestamp": 1326363433324
}

任何人都能够帮助我解说这一点,以便解决问题? 感谢!

最佳回答

问题! <>Content-Type MUST beapplication/json in order to work! 我想x-li-format: json <>/strong> 够了,但NOT。

问题回答

暂无回答




相关问题
ajax login using httpRequest?

I am trying to develop my login script to give feedback to the user if the login is valid or not. Basically if it isn t correct a div box will show saying its wrong, if its correct it will show its ...

Remotely authenticating client Windows user on demand

Suppose I am writing a server for a particular network protocol. If I know that the client is running on a Windows machine, is it possible for my server to authenticate the Windows user that owns the ...

Role/Permission based forms authorizing/authentication?

While looking into forms authorizing/authentication, I found that it is possible to do role based authorizing by adding an array of roles to a FormsAuthenticationTicket. That way I can write User....