my <https.post> method in suitescript doesn't post...
# ask-stanley-ai
n
my https.post method in suitescript doesn't post but using postman it posts why is that
c
AI generated answer (using internal Slack threads):
Based on the conversations, there could be several reasons why your
<http://https.post|https.post>
method in SuiteScript doesn't post while it does in Postman. Here are some possible reasons and solutions: 1. Headers and Body Formatting: Ensure that the headers and body of your request are correctly formatted. In SuiteScript, headers are typically an object with key-value pairs, and the body is a stringified JSON object. For example:
Copy code
javascript
var headers1 = [];
headers1['Content-Type'] = 'application/json';
var body1 = JSON.stringify({
  name: 'John',
  email: '<mailto:john@example.com|john@example.com>',
  job: 'developer'
});
2. URL Formatting: Make sure the URL you're posting to is correctly formatted. If you're using
url.resolveScript
to get the URL, you don't need to add the domain into the URL. 3. Suitelet Deployment: If you're trying to call a Suitelet from a User Event Script, ensure that the Suitelet is correctly deployed and the 'Available Without Login' option is checked. 4. Testing with Postman: If you're still having issues, try testing your request with Postman or a similar tool. This can help you identify if the issue is with your SuiteScript code or the server you're posting to. 5. Server Configuration: If your request works with other servers but not with a specific one, there might be a configuration issue with that server. Check the server logs for any errors or clues about what might be going wrong. Remember to replace any sensitive data like URLs or email addresses with placeholders when sharing your code. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.846669078
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.844418883
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.842318416
Please provide your feedback on this answer.