I want to call a webservice with this http-get command
This is an authenticated service and I need to send this header:
Authorization: Bearer ack5yfdffzbdtgjq44cjgm2j54s
Content-Type: application/x-www-form-urlencoded
How can I attach the autorization in the request-header?
You can also use
rbv_api.sendJSONRequest(url, null, "GET", contentType, username, password, headers)
If you pass username and password, this API will add basic authentication header for you. Otherwise use last parameter to pass HTTP headers.
Can you provide more information on how you are sending this request? Rollbase can send GET requests using either 'Send HTTP GET Request' trigger type or 'rbv_api.sendHttpGet' API.
Also, have you considered using 'Send HTTP POST Request' trigger type? For this particular trigger type, the HTTP header can be configured on the trigger properties.
rbv_api.senfHttpPost API can include array of HTTP headers as well.
OK, I used the 'Send HTTP GET Request' trigger type, but I can of course switch to the 'rbv_api.sendHttpGet'.
Can anyone tell me how to attach the http headers?
You can also use
rbv_api.sendJSONRequest(url, null, "GET", contentType, username, password, headers)
If you pass username and password, this API will add basic authentication header for you. Otherwise use last parameter to pass HTTP headers.
Thank you, this works fine!