Created
October 13, 2016 17:43
-
-
Save alxy/c6eb402fd278fd2635455550b50847d2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$this->client = new Client([ | |
'base_url' => 'https://app.snipcart.com/api/', | |
'auth' => [ | |
'ST_NTI3OTljM.......', | |
':' | |
], | |
'headers' => [ | |
'accept' => 'application/json' | |
] | |
]); | |
$response = $this->client->request('GET', 'orders', ['query' => $parameters]); // This leads to a curl error (hostname could not be resolved) | |
// ---------------------------------------- | |
$this->client->request('GET', 'https://app.snipcart.com/api/orders?offset=0&limit=50&status=processed', [ | |
'auth' => [ | |
'ST_NTI3OT.....', | |
':' | |
], | |
'headers' => [ | |
'accept' => 'application/json' | |
]]) | |
->getBody()->getContents(); | |
// This works as expected, what is the difference? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment