Page MenuHomeFeedback Tracker

RestApi / cURL Extend Capabilities
Assigned, UrgentPublic

Description

Expand capabilities of RestApi.c. Support for custom headers per request and support all http verbs.

The current curl implementation in dayz does not support all http verbs, such as PUT, PATCH, and DELTE. Which makes it difficult to implement CRUD based REST API's. Also some api's require custom headers to specific endpoints, like an Authorization header, and we only have access to modify the Content-Type header, a wrapped array for custom headers would be nice to pass per request.

Details

Severity
Tweak
Resolution
Open
Reproducibility
N/A
Operating System
Windows 10 x64
Category
General

Event Timeline

Geez changed the task status from New to Assigned.Mar 11 2022, 11:37 AM
This comment was removed by OfficialWardog.
TheNeco removed a subscriber: TheNeco.
tonic85 added a subscriber: tonic85.Jun 7 2022, 9:25 PM

I've been using a work around with POST request and setting custom headers, but this only works for POST request, as by default SetHeader only sets Content-Type headers, using this work around with GET requests fails, because GET request by standard does not have a request body, which is why SetHeader is ignored.

Workaround: ctx.SetHeader("\r\nAuthorization: Bearer " + token + "\r\nContent-Type: application/json");

I'd like to see if we can get any progress on implementing full CRUD operations, as well as custom headers. Or for a quick fix, can we get SetHeader to work with GET requests as a temporary workaround solution.