Skip to content

Instantly share code, notes, and snippets.

@jasp402
Created August 1, 2017 18:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasp402/bfa66e54d44824c6574400b510c556d1 to your computer and use it in GitHub Desktop.
Save jasp402/bfa66e54d44824c6574400b510c556d1 to your computer and use it in GitHub Desktop.
JS - Bot's (Sending data to server using Sync-request)
// Seding data through sync-request
// ========================================================================
let sendServer = request('POST', key.serverUrl,
{
headers: {'content-type': 'application/x-www-form-urlencoded'},
body : 'username=' + key.username + '&password=' + key.password + '&botName=cigna&request=save&data='+objsToServer
});
let responseBody = sendServer.getBody();
console.log(responseBody.toString());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment