Page MenuHomeFeedback Tracker

Rest API GET does not send headers, RestContext needs proper function(s) to add or set alternative headers and API variables
Awaiting internal Testing, NormalPublic

Description

This is a form to report an issue from the PC VERSION of the game - for Xbox/PS4 issues use their respective forms from the dropdown menu (delete this prior to creating the ticket)

The attached screenshot is the API call received for the GET and POST commands

As you can see, the GET command is lacking the headers but the POST command sends them fine!

Also, we currently have to use a hacky solution to get around the header limitations, as seen below. I seen an old report on this, but it hasn't been acted on

A function(s) to properly define headers and other API variables would be great!

	void SendTestAPICall()
	{
		string testData = "HelloWorld";
		string exampleBearer = "123456";
		string url = "https://webhook.site/<SNIP>?testdata=" + testData;
		string headers = "application/json\r\nUser-Agent: Some_Example\r\nAuthorization: Bearer " + exampleBearer;

		RestContext ctx = GetRestApi().GetRestContext(url);
		ctx.SetHeader(headers);
		ctx.POST(new RestCallback, "", "");
		ctx.GET(new RestCallback, "");
	}

Details

Severity
Major
Resolution
Open
Reproducibility
Always
Operating System
Windows 10
Operating System Version
N/A
Category
General
Steps To Reproduce

Use my test function above

Event Timeline

xplosiff created this task.Dec 28 2024, 5:21 AM
xplosiff updated the task description. (Show Details)Dec 28 2024, 5:25 AM
Geez changed the task status from New to Awaiting internal Testing.Jan 3 2025, 12:03 PM

I am also waiting for the proper headers setup feature. It will allow modders to interact with existing REST API solutions without reinventing the wheel. Thanks!