Skip to content

PestJSON forces Accept and Content-Type headers #63

Description

@jusurb

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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