Unable to capture http result request headers

679 Views Asked by At

good afternoon,

I’m working on an integration of UiPath with ServiceNow and I would like to know how I can use the result of the HTTP request:

“{“result”:[{“u_bot_ip_name”:“teste ipname”,“u_number”:“RPA0001007”,“u_bot_codigo_af_sng”:”",“u_bot_data_hora_sng”:"",“u_bot_host_name”:“teste hostName”,“sys_mod_count”:“1”,“u_bot_chassi”:"",“sys_updated_on”:“2021-05-21 19:38:53”,“u_bot_state_sng”:"",“sys_tags”:"",“u_bot_created_on_ref”:"",“u_bot_number_ref”:"",“u_bot_razao_social”:"",“u_bot_solicitacao”:"",“sys_id”:“6b8d01451b987c5058df76295b4bcbba”,“u_bot_codigo_af”:"",“sys_updated_by”:“11548.111.0001RAFS”,“sys_created_on”:“2021-05-21 18:00:23”,“u_bot_state”:"",“u_bot_updated_on_ref”:"",“u_bot_environment_name”:"",“u_bot_user_name”:“rafael.souza1”,“sys_created_by”:“11548.111.0001RAFS”}]}"

To get only column headers (In Bold) in a For Each Loop

I'm storing the result of the request in an array variable CType(out_get_JsonObj("result"), JArray)and I can get the values ​​normally except headers:

Code Example

Can you give me some guidance?

1

There are 1 best solutions below

1
On

I am assuming that you are using the UiPath.Web.Activities package for making the HTTP request. The HttpClient activity in this package provides three outputs: response (String), headers (Dictionary<String, String>), and statusCode (Int32). If you need to process the response headers in a subsequent activity, you need to store it as a different variable.