Problem/Motivation

(1) Currently there is no way of specifying headers with a request being made with the TrustpilotApiClient.
(2) Also trying to send a POST request fails because for a POST request the API expects a JSON encoded body.

Steps to reproduce

Proposed resolution

(1) Allow endpoint plugins to specify (optional) headers that can be picked up and used with the request.
(2) Also detect if the type of endpoint request is POST, then set the correct flag in the request options so that Guzzle will send a JSON encoded body.

Remaining tasks

User interface changes

API changes

Data model changes

Add additional headers property to the Endpoint plugin, with appropriate getter.

Comments

rossb89 created an issue. See original summary.

rossb89’s picture

Status: Active » Needs review
StatusFileSize
new3.14 KB

Patch attached.

  • daggerhart committed 3844975c on 1.0.x
    Issue #3309616 by rossb89: Allow endpoints to specify additional headers...
daggerhart’s picture

Status: Needs review » Fixed

Hi @rossb89,

Thanks for the help! Reviewed, tested, and merged: 3844975c.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.