HTTP Request not sending headers

studio
p_qa
http

#1

Scenario:

I’ve created a HTTP request and set some headers and UiPath doesn’t seem to be sending the headers with the request.

Steps to reproduce:

  1. Create HTTP Request activity
  2. Set as POST request to URL with body as JSON
  3. Add headers (Cookie, User-Agent etc.)
  4. Inspect request using Fiddler

Fiddler shows the below:

    POST https://example.com/request.service HTTP/1.1
    Pragma: no-cache
    Accept: application/json
    User-Agent: RestSharp/105.0.1.0
    Content-Type: application/json
    Content-Length: 319
    Accept-Encoding: gzip, deflate
    Connection: Keep-Alive

Current Behavior:

Headers not being sent

Expected Behavior:

Headers should be sent

Last stable version: 2017.1.6522
OS Version: Windows 10 (1709)


#2

Hey Taylor,

I see you are trying to create the parameters as arguments. But when your create a http request you have the option to include the header parameters in the http request itself rather than passing as arguments (I just provided the fields snippet for your reference below). Try passing those values in these parameters and try hopefully it should work.

Best,
Siddartha


#3

Are you referring to the wizard where you can add headers/parameters etc? That only adds the headers to the same collection that you show in your screenshot.


#4

Based on recent tests, the cookie issue is still present.

This really should get fixed. Being only able to make cookieless HTTP requests is a major shortcoming.

Fortunately you can still create a custom activity to handle requests with cookies, so at least there’s a workaround available, albeit somewhat scary for users with non-programmer background.