2015-04-07 88 views
0

我試圖讓API調用:https://api.linkedin.com/v1/companies/2414183/sharesLinkedIn HTTP響應不是碼201

LinkedIn返回一個數組的錯誤,我不明白是什麼問題。

幾天前,一切正常。

array(5) { 
'linkedin' => 
    string(5487) "<!-- EF of static content included--> 
<html> 
<head> 
    <title>Error</title> 
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"> 
    <style type="text/css"> 
/* GLOBAL */ 
body { margin: 0; padding: 0 0 10px 0; background: #FFF; color: #000; font: 82% arial, helvetica, "Nimbus Sans L", sans-serif; text-align: center; min-width: 775px; } 
table { font-size: 100%; border: 0; } 
th { text-align: left; } 
tr.tblhdr { background: #999; } 
.helper { font-size: 85%; } 
.spacer { clear: both; line-height: 0; height: 0; _font-size: 1px; } 
.indent { margin-left: 35px; } 
.top { margin-top: 0 !important; } 
.bottom { margin-bottom: 0 !important; } 
.btn { text-align: center; } 
.right { text-align: right; } 
.preview { background: #9CF; } 
.even, .odd { background: #EEE; } 
abbr { text-decoration: none; border: none; font-style: normal; } 
sup { font-size: 70%; } 
div.skip { position: absolute; left: -999px; width: 990px; } 
.dim { color: #999 !important; } 
.vmid { vertical-align: middle; } 
.vtop { vertical-align: top; } 
."... 
    'info' => 
    array(26) { 
'url' => 
string(52) "https://api.linkedin.com/v1/companies/2414183/shares" 
'content_type' => 
string(9) "text/html" 
'http_code' => 
int(405) 
'header_size' => 
int(439) 
'request_size' => 
int(497) 
'filetime' => 
int(-1) 
'ssl_verify_result' => 
int(0) 
'redirect_count' => 
int(0) 
'total_time' => 
double(2.5) 
'namelookup_time' => 
double(0) 
'connect_time' => 
double(0.062) 
'pretransfer_time' => 
double(1.265) 
'size_upload' => 
double(1328) 
'size_download' => 
double(5487) 
'speed_download' => 
double(2194) 
'speed_upload' => 
double(531) 
'download_content_length' => 
double(5487) 
'upload_content_length' => 
double(1328) 
'starttransfer_time' => 
double(2.265) 
'redirect_time' => 
double(0) 
'certinfo' => 
array(0) { 
} 
'primary_ip' => 
string(14) "255.255.255.255" 
'primary_port' => 
int(443) 
'local_ip' => 
string(13) "255.255.255.255" 
'local_port' => 
int(30965) 
'redirect_url' => 
string(0) "" 
    } 
    'oauth' => 
    array(2) { 
    'header' => 
    string(329) "Authorization: OAuthrealm="http%3A%2F%2Fapi.linkedin.com",oauth_version="1.0",oauth_nonce="d2475a156755d8f6aece5a783ec4f8bd",oauth_timestamp="1428413208",oauth_consumer_key="xxxxx",oauth_token="xxxxx",oauth_signature_method="HMAC-SHA1",oauth_signature="xxxxxxx" 
'string' => 
string(299) "POST&https%3A%2F%2Fapi.linkedin.com%2Fv1%2Fcompanies%2F2414183%2Fshares&oauth_consumer_key%xxxxx%26oauth_nonce%3Dd2475a156755d8f6aece5a783ec4f8bd%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1428413208%26oauth_token%xxxxx%26oauth_version%3D1.0" 
    } 
    'success' => 
    bool(false) 
    'error' => 
    string(54) "HTTP response from LinkedIn end-point was not code 201" 
} 

更詳細的調查後指出,職位不發送,其中的字段「標題」或「意見」包含特殊字符,如$/。 第一個示例成功發佈,但第二個返回上面的錯誤;

1.

<?xml version="1.0" encoding="UTF-8"?> 
<share> 
<content> 
    <title>1 oz Britannia Silver Coin 999</title> 
    <submitted-url>http://example.com</submitted-url> 
    <submitted-image-url>http://example.com/image.jpg</submitted-image-url> 
    <description>Some text</description> 
</content> 
<comment>Overview of 1 oz Britannia Silver Coin 999</comment> 
    <visibility> 
     <code>anyone</code> 
    </visibility> 
</share> 

2.

<?xml version="1.0" encoding="UTF-8"?> 
<share> 
    <content> 
     <title>1 oz Canadian Vancouver Olympics Thunderbird Totem $50 Gold Coin 9999</title> 
     <submitted-url>http://example.com</submitted-url> 
     <submitted-image-url>http://example.com/image.jpg</submitted-image-url> 
     <description>Some text</description> 
    </content> 
    <comment>Overview of 1 oz Canadian Vancouver Olympics Thunderbird Totem $50 Gold Coin 9999</comment> 
    <visibility> 
     <code>anyone</code> 
    </visibility> 
    </share> 
+0

我後能得到您的令牌調試了一下,並意識到我linkedIn返回HTML頁面404,可能是來自API服務器的響應問題,因爲我無法保持跟蹤依賴的發送內容的類型錯誤。由於一些帖子發送正確。 –

回答

相關問題