RadicalActivity
4 months ago
705
4
Laravel

Laravel HTTP::post() not working with `body`

Posted 4 months ago by RadicalActivity

I'm using Laravel 7.6 and trying to pass "body" data to a POST request like this:

$response = Http::post('https://domain.com', ['body' => '{ test: 1 }']);

However, I get 400 Bad Request - Client error. The client expects me to send body value along with the request.

What could I be missing here?

Please sign in or create an account to participate in this conversation.