Skip to content

Always get "Bad request (400)" #335

@tonebender

Description

@tonebender

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions