2014-07-07 19 views
0

我從Userapp.io服務這是煩人的錯誤:http請求未響應POST選項集(PHP)?

{ 「ERROR_CODE」: 「INVALID_HTTP_METHOD」, 「消息」: 「無法執行請求 請求必須是 'POST' 或 '選項'。」 }

我告訴我這不是正在使用$context = stream_context_create($options);

我寫

$options = array("https" => array(
        "method" => "POST", 
        "header" => "Authorization: " .$access_token . "\r\n" . 
        "Content-Type: application/json" . "\r\n" . 
        "Content-Length: 56" . "\r\n" . 
        "Host: api.userapp.io:443" . "\r\n"), 
        "content" => $data 
    ); 

下面的代碼

有誰知道它爲什麼會反映?

我用$fp = fopen($url, 'r', true, $context);

回答