hey guys! wondering if anybody has experience doin...
# suitescript
m
hey guys! wondering if anybody has experience doing a POST via the N/https/requestRestlet() method. The method seems to work fine for a GET, but just gives an unexpected error anytime include any body
b
what does the code look like
r
I’d recommend checking these options: 1. Content Type: Ensure the Content-Type header is set correctly. For JSON, it should be application/json. 2. Body Format: Make sure the body is properly formatted. For JSON, this would mean a valid JSON string. 3. Method Specification: Verify that the method is correctly set to ‘POST’ in the options. 4. Input Data: Check the data being sent in the body for any inconsistencies or formatting issues that could cause an error.
m
I appreciate that Ryan! The fix was indeed to specify the Content-Type header.
👍 1