Skip to content

PestJSON forces Accept and Content-Type headers #63

Open
@Gamesh

Description

@Gamesh

Hi,

in PestJson there are harcoded headers

protected function prepRequest($opts, $url)
{
$opts[CURLOPT_HTTPHEADER][] = 'Accept: application/json';
$opts[CURLOPT_HTTPHEADER][] = 'Content-Type: application/json';
return parent::prepRequest($opts, $url);
}

the problem is that they cannot be changed and in some situations, like working with Microsoft Sharepoint API you need a little bit different format:

Accept: application/json;odata=verbose
Content-Type: application/json;odata=verbose

maybe these default headers could be stored in a protected property, that can be overridden if needed, that would be more flexible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions