Accept & Content-Type

The withAccept() and withContentType() are shortcut methods for setting the Accept and Content-Type headers.

Accept

Use withAccept() to set the Acceptopen in new window Http Header.

$builder = $client
        ->withAccept('text/xml');

Content-Type

Use withContentType() to set your request's Content-Typeopen in new window.

$builder = $client
        ->withContentType('text/xml');