Hi everyone,
Can we send body in GET request using https module in suitescript to an api. The api only accepts GET request and one argument in body? I am not able to get data from api due to this.
Thanks
b
battk
06/30/2023, 12:44 PM
no, its more likely they want the argument in the query parameters
battk
06/30/2023, 12:44 PM
gets dont have a body
s
Shawn Talbert
06/30/2023, 7:07 PM
I don't think the specs forbid a body for HTTP GET, but it seems to never be done in practice, and NS N/https doesn't support it.
k
Kuldeep Singh
07/03/2023, 7:02 AM
@battk@Shawn Talbert is there any other approach that I can use in Suitescript to hit the api with parameter?
Thanks
s
Shawn Talbert
07/05/2023, 4:07 PM
one approach would be to introduce a middleman to make the GET-with-body call for you. From NS, HTTP POST+body the request to your middleman, which then forwards the request via HTTP GET+body to your target endpoint then relays the result back to NS.
k
Kuldeep Singh
07/09/2023, 9:39 AM
@Shawn Talbert Thank You, I will try this approach.