0

I am testing REST based request. Here is the snippet from the node http request sample.

var requestTxt = 'test';

var headers = {
    'Content-Type': 'text/plain',
    'Content-Length': requestTxt.length,
    'Solace-Reply-Wait-Time-In-ms': 30000
}   

reqOptions{
    host: '10.28.112.100',
    port: 9000,
    path: '/tutorial/requests',
    method: 'POST',
    headers: headers
}

The above options and headers works for VMR with default VPN and username. Now I have a VPN setup with username. Anybody know how and where we can specify VPN and username info in an REST/HTTP request ?

I followed the javascript example and tried the keys below for REST request but no luck :

reqOptions{
    host: '10.28.112.100',
    port: 9000,
    path: '/tutorial/requests',
    method: 'POST',
    headers: headers

    vpnName: 'TEST_VPN_2',
    username: 'user'
}
FelixSFD
  • 6,052
  • 10
  • 43
  • 117

1 Answers1

0

You can use the HTTP Authorization header to specify the username/password. A “username:password’ is encoded into a single base64 string, which spans the “:”.

Here is an example for user Aladdin, password OpenSesame:

Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l

You can refer to the complete list of HTTP headers over here.

Russell Sim
  • 1,693
  • 2
  • 14
  • 22