Advertisement
Guest User

Untitled

a guest
Jan 17th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. $client = new GuzzleHttpClient();
  2. try {
  3. $request = new GuzzleHttpPsr7Request('PUT', config('cms.api.backend') .'/products/'. $nid,
  4. [
  5. 'auth' => [config('cms.api.user'), config('cms.api.password')],
  6. 'form_params' => [
  7. 'copywrite' => Input::get('copywrite'),
  8. 'status' => $status
  9. ],
  10. ]);
  11. $promise = $client->sendAsync($request)->then(function ($response) {});
  12. $promise->wait();
  13. }
  14. catch (RequestException $e) {
  15. $this->logHttpError($e->getResponse()->getStatusCode(), $e->getResponse()->getBody(true));
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement