Hi Kam,
It sounds like you're encountering an issue with receiving an HTML response instead of JSON from your POST requests. This often happens when the API endpoint is not properly set up to return JSON, or if the Accept
header is missing from your request.
You can try adding the following header to your POST request to ensure you're explicitly requesting a JSON response:
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': `Bearer ${yourToken}`
}
Make sure that the URL you're sending the request to is the correct API endpoint for JSON data. If the endpoint still returns HTML, the issue could be on the server side, where the API might need to be configured to return the correct response type.
Also, double-check the documentation for the AoC, Node, and Transfer SDK APIs to ensure that you're using the right endpoints and methods for JSON responses.
I recently worked on a Roblox exploit project, and while it's a different field, API issues can pop up across domains. If you're interested, you can check out my work at DeltaExector. Hopefully, this helps! Let me know how it goes.
Best of luck!
------------------------------
Jaquelin Langworth
------------------------------
Original Message:
Sent: Wed July 17, 2024 09:13 AM
From: Kam Dudwal
Subject: HTML response instead of JSON
Hi, I am currently attempting to send a package and then go into uploading and downloading using the AoC, Node and Transfer SDK APIs. However at the moment I have created the bearer token and run the POST requests but am only getting an HTML response when I need a JSON response. I was wondering if anyone could help? I have tried a variety of things but don't know where the source of the problem is. Any information would be a great help. Thanks! Kam
------------------------------
Kam Dudwal
------------------------------
#IBMAdvancedStudies