Wednesday, June 28, 2017

Laravel Forge API With Payload



use GuzzleHttp\Exception\GuzzleException;
use GuzzleHttp\Client;



$request = $client->request('POST', 'servers/123123/sites', [
'headers' => [
'Authorization' => 'Bearer '.$forgeApiToken,
'Accept' => 'application/json',
'Content-Type' => 'application/json'
],
'json' => [
"domain" => "site.com",
"project_type" => "php"
]




]);



return json_decode($request->getBody(), true);

4 comments:

  1. Thank you for sharing such useful information. I really enjoyed while reading your article and it is good to know the latest updates. Do post more. And also read about Laravel Development Company

    ReplyDelete
  2. Laravel with our team of talented developers at Connect Infosoft Technologies. Hire Laravel Developers in India skilled professionals are well-versed in the latest trends and best practices, ensuring exceptional results that boost your online presence.

    ReplyDelete