1. 程式人生 > >HTTP request failed! HTTP/1.1 411 Length Required

HTTP request failed! HTTP/1.1 411 Length Required

head https stream request length sssss ron led col

     $opts = array(
        http=>array(
          method=>"POST",
          ‘header‘  => ‘Content-Length: 0‘   //這裏不要寫其他header
        )
      );      
      $context = stream_context_create($opts);
      $token_url = "https://ssssssss/cmtlists/gentoken";
      $post_id_str = file_get_contents($token_url, false
, $context);

HTTP request failed! HTTP/1.1 411 Length Required