Guzzle + PUT request to Github === 404

Hello,

I’m using Guzzle to connect to Github. Everything works fine but for PUT requests. I’m trying to create a file in a repo.

	$body = array(
  		"message" => "some commit",
  		"content" => base64_encode("some content")
  	);
  	
  	$body = json_encode($body);
  	
  	$response = $client->put('/repos/jjshell/test/contents/test.txt?access_token=_secret_', array(
	    'Content-Type' => 'application/x-www-form-urlencoded'
	), $body)->send();
	
	echo $response->getBody();

The access_token has been generated in Github’s user control panel. I tried to list its authorizations, the scopes look good (“public_repo” appears in it).

Here’s the relevant Github link: http://developer.github.com/v3/repos/contents/

I’m probably missing something obvious. I tried to add my access_token to $body without success: I’m always getting a 404, but I suspect it’s a Github 403 in disguise.

Been trying and testing for a week now. I’m runngin out of ideas.

Anyone?

Thanks in advance.

-jj. :slight_smile: