laravel send http post request json
use GuzzleHttp\Client;
class yourController extends Controller {
public function saveApiData()
{
$client = new Client();
$res = $client->request('POST', 'https://url_to_the_api', [
'form_params' => [
'client_id' => 'test_id',
'secret' => 'test_secret',
]
]);
echo $res->getStatusCode();
// 200
echo $res->getHeader('content-type');
// 'application/json; charset=utf8'
echo $res->getBody();
// {"type":"User"...'
}
Also in JavaScript:
- infinite scroll javascript
- javascript check if undefined or null
- check if message mentions users discord js
- disable a button react
- string json to object c#
- java.lang.IllegalArgumentException: Can only download HTTP/HTTPS
- pegar qual domínio eu estou javascript
- how to make a grocery list in javascript
- install cypress
- angular on back skip routes
- string literals javascript
- onclick start and stop the count react
- javascript button
- v-for vuejs
- filter array with unique objects javascript
- nodejs get file size
- checking if a character is an alphabet in js
- express jwt
- jquery slideup
- sort array based on another array js
- Adding an event listener to an element that doesn't exist yet
- user account in react
- jquery validate on keyup
- statusbar.sethidden(true) in react native