Skip to content

Instantly share code, notes, and snippets.

@ramlev
Last active March 16, 2016 16:39
Show Gist options
  • Save ramlev/d57e4564a2fb4c20982b to your computer and use it in GitHub Desktop.
Save ramlev/d57e4564a2fb4c20982b to your computer and use it in GitHub Desktop.
<?php
use GuzzleHttp\Client;
$client = new Client();
$client->request('POST', 'http://localhost:8080/ag-push/rest/applications/{PUSH_ID}/iOS', [
'debug' => true,
'headers' => [
'Authorization' => 'Bearer OAUTHTOKEN',
'Accept' => 'application/json'
'Content-type' => 'multipart/form-data',
],
'multipart' => [
[
'name' => 'production',
'contents' => 'true',
],
[
'name' => 'passphrase',
'contents' => 'passw0rd',
],
[
'name' => 'certificate',
'contents' => fopen('/Users/matzew/Desktop/MyProdCert.p12', 'r'),
],
],
]);
User-Agent: GuzzleHttp/6.1.1 curl/7.47.1 PHP/5.6.19
Content-Type: multipart/form-data; boundary=56e97c6435a37
Authorization: Bearer OAUTHTOKEN
Content-Length: 1838
* upload completely sent off: 1838 out of 1838 bytes
< HTTP/1.1 400 Bad Request
< Date: Wed, 16 Mar 2016 15:31:49 GMT
< Server: WildFly/8
< Expires: 0
< Cache-Control: no-cache, no-store, must-revalidate
< X-Powered-By: Undertow/1
< Pragma: no-cache
< Content-Type: text/html
< Content-Length: 80
< Connection: close
<
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment