DEV Community

Discussion on: Passing request data as XML in Laravel Http Client

Collapse
 
gpakyoo profile image
Godluck Akyoo

If you are using Laravel 7+ it is even easier

Http::withHeaders(["Content-Type" => "text/xml;charset=utf-8"])
->post(self::CREATE_TOKEN_ENDPOINT, ['body' => $xml]);