cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2329
Views
0
Helpful
2
Replies

How do I get an HTTP API response from a get/post

ninjamaster5280
Level 1
Level 1

I'm trying to get a response from a simple url request with the api, but I can't seem to find a way to get the return information back.  I'm able to post information to a website correctly, but there is supposed to be a return body that displays if it was successful or not.  The following code is similar to what i'm trying to run. I want to be able to post information to a webserver, and get a response back from the page that is requested.

 

function run_command() {
var url = 'http://192.168.0.1/index.html&data=test';
var response = xapi.command('HttpClient Get', { 'Url': url});
console.log(response);
}


}

1 Accepted Solution

Accepted Solutions

Magnus Ohm
Cisco Employee
Cisco Employee
2 Replies 2

Magnus Ohm
Cisco Employee
Cisco Employee

Hi, I have written something about this in the following blog post:

 

https://community.cisco.com/t5/collaboration-voice-and-video/ce9-6-x-ce9-8-x-in-room-control-and-macros-usb-input-devices/ba-p/3765081

 

Hope it is helpful.

 

/Magnus

This worked thank you. This helped me figure it out thanks.