I just got started with Requests, using it with php5.6.
For some reason I get the response "Bad request" (400) on every GET and POST request I try.
I've tested this:
$response = Requests::get('https://github.com/timeline.json');
with a number of URLs and they do respond (I get a github page) but they all say "Bad request" (400).
Tried with POST as well, the example in the docs:
$url = 'https://api.github.com/some/endpoint';
$headers = array('Content-Type' => 'application/json');
$data = array('some' => 'data');
$response = Requests::post($url, $headers, json_encode($data));
var_dump($response->status_code);
But it also gives 400.
Sorry for the noob question, but where do I begin to find the cause for this?
Is it because I'm using php 5.6?
Thanks!
I just got started with Requests, using it with php5.6.
For some reason I get the response "Bad request" (400) on every GET and POST request I try.
I've tested this:
$response = Requests::get('https://github.com/timeline.json');
with a number of URLs and they do respond (I get a github page) but they all say "Bad request" (400).
Tried with POST as well, the example in the docs:
$url = 'https://api.github.com/some/endpoint';
$headers = array('Content-Type' => 'application/json');
$data = array('some' => 'data');
$response = Requests::post($url, $headers, json_encode($data));
var_dump($response->status_code);
But it also gives 400.
Sorry for the noob question, but where do I begin to find the cause for this?
Is it because I'm using php 5.6?
Thanks!