Hi everyone, Can we send body in GET request usin...
# suitescript
k
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
no, its more likely they want the argument in the query parameters
gets dont have a body
s
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
@battk @Shawn Talbert is there any other approach that I can use in Suitescript to hit the api with parameter? Thanks
s
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
@Shawn Talbert Thank You, I will try this approach.