2
我正在使用WordPress的HTTP API,它有cURL的包裝(我會假設它可以完成PHP的cURL所做的一切)。GitHub API與PHP的cURL沒有得到正確的狀態響應
試圖通過API來檢查下列頭If-None-Match
和If-Modified-Since
應該返回:
Status: 304 Not Modified
相反,我得到一個Status: 200 OK
測試卷曲在命令行中工作正常,返回正確的狀態,這個工程:
curl -i https://api.github.com/users/wycks -H 'If-None-Match: "7efeb402e491989a4f37d8d82aae8946"'
輸入相同的ETag在PHP 'If-None-Match' => '7efeb402e491989a4f37d8d82aae8946'
d沒有工作。
這是我的PHP請求API:
array
'method' => string 'HEAD' (length=4)
'timeout' => int 5
'redirection' => int 0
'httpversion' => string '1.0' (length=3)
'user-agent' => string 'WordPress/3.5; http://dev.local/Foo15' (length=37)
'blocking' => boolean true
'headers' =>
array
'Accept-Encoding' => string 'deflate;q=1.0, compress;q=0.5' (length=29)
'cookies' =>
array
empty
'body' => null
'compress' => boolean false
'decompress' => boolean true
'sslverify' => boolean false
'stream' => boolean false
'filename' => null
'If-None-Match' => string '7efeb402e491989a4f37d8d82aae8946' (length=32)
'Cache-Control' => string 'must-revalidate' (length=15)
'_redirection' => int 0
'ssl' => boolean true
'local' => boolean false
boolean true
而且錯誤響應:
response' =>
array
'code' => int 200
'message' => string 'OK' (length=2)