Allow endpoints to specify additional headers, Enable POST requests to correctly send a JSON body

Created on 14 September 2022, over 2 years ago
Updated 10 August 2023, over 1 year ago

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.

✨ Feature request
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom rossb89 Bristol

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024