cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements

191
Views
5
Helpful
0
Replies
TNorton
Beginner

xapi HttpClient Post method timing out (solved)

EDIT: This issue has been solved. The request and reply were simply being blocked by a network configuration. Thank you for all the views.

 

Hello, I hope this is the right place for this question. I've been tasked with developing macros for a series of codecs, and a large part of that is dependent on networking. I'm currently working out the simplest possible way to send a Post request before writing the rest of the scripting for requested features, but I have only managed to have the post request timeout in the console after 30 seconds, and no related traffic is going out across the network. The relevant code is as follows and I thank anyone who takes a look.

 

import xapi from 'xapi';

xapi.event.on('UserInterface Extensions Widget Action', (event) => {
  if (event.WidgetId === 'error_report' && event.Type === 'pressed') {
    xapi.command('HttpClient Post',
    {
    Header: ["Content-Type: text/xml"],
    Url"(Redacted)/post.php",
    AllowInsecureHTTPS"True",
    ResultBody'plaintext'
    },
    "name=(redacted)&message=message"
    )
     .then((response) => {
         console.debug(`received response with status code: ${response.StatusCode}`);
     })
}});
0 REPLIES 0
Create
Recognize Your Peers
Content for Community-Ad