Skip to main content
Question

How does httprequest work in a client command?


durette
Superhero (Customer)
Forum|alt.badge.img+19
  • Superhero (Customer)
  • 526 replies

Could I get a “Hello World” example of how to make an httprequest in a client command? I’m trying to do something like this:

 

 

4 replies

Forum|alt.badge.img+6

Hi @durette,
Were you able to run the  httprequest in a client command? 

I was not able to run your “Hello World” example using https://postman-echo.com/get. I encountered the same problem when trying to use the example address below:

httprequest "https://api.open-meteo.com/v1/forecast?latitude=52.2298&longitude=21.0118&current_weather=true"

In debug console (DevTools) I see CORS error.

 

What worked for me were only the very simple examples below:

command TestCommand1 for Xyz {
   execute {
      httprequest "https://jsonplaceholder.typicode.com/posts/1" into ResponseText {
         redirect = true;
         method = GET;
         header "Accept", "application/json";
      }
      info("${ResponseText}");
   }
}

 

command TestCommand2 for Xyz {
   execute {
      httprequest "https://httpbin.org/post" into ResponseText {
         redirect = true;
         method = POST;
         header "Content-Type", "application/xml";
         body "<note><to>Tove</to><from>Jani</from><heading>Reminder</heading><body>Don't forget me this weekend!</body></note>";
      }
      info("${ResponseText}");
   }
}



 


Forum|alt.badge.img
  • Do Gooder (Partner)
  • 2 replies
  • March 12, 2025

Hi ​@Tomasz Grzebula  I tried calling this API with my current latitude and longitude as shown below,
 

but I encountered an error.
 

Could you help me understand how to get a response from this API?


Forum|alt.badge.img+6

@Lekshmikanth,
According to my experience, apart from very simple examples, httprequest in a client command generally doesn’t work. Additionally it seems to be undocumented feature.


Forum|alt.badge.img
  • Do Gooder (Partner)
  • 2 replies
  • March 13, 2025

Okay Thankyou ​@Tomasz Grzebula 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings