<?php
namespace AppHttpControllers;
use IlluminateSupportFacadesHttp;
class ITSController extends Controller
{
/**
* Write code on Method
*
* @return response()
*/
public function index()
{
$apiURL = 'https://api.mywebtuts.com/api/users';
$postInput = [
'first_name' => 'Hardik',
'last_name' => 'Savani',
'email' => 'example@gmail.com'
];
$headers = [
'X-header' => 'value'
];
$response = Http::withHeaders($headers)->post($apiURL, $postInput);
$statusCode = $response->status();
$responseBody = json_decode($response->getBody(), true);
dd($responseBody);
}
}