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

xapi HttpClient Post method timing out (solved)

TNorton
Beginner
Beginner

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
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: