Mimic CURLOPT_POST in GuzzleHttpRequest
[lhc/web/wiklou.git] / includes / http / GuzzleHttpRequest.php
index fa6dad7..4741ead 100644 (file)
@@ -140,6 +140,10 @@ class GuzzleHttpRequest extends MWHttpRequest {
                                $this->guzzleOptions['form_params'] = $postData;
                        } else {
                                $this->guzzleOptions['body'] = $postData;
+                               // mimic CURLOPT_POST option
+                               if ( !isset( $this->reqHeaders['Content-Type'] ) ) {
+                                       $this->reqHeaders['Content-Type'] = 'application/x-www-form-urlencoded';
+                               }
                        }
 
                        // Suppress 'Expect: 100-continue' header, as some servers