Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

5.1 tHttpRequest get Http Status Code

Hi,
I have a job sending data to a webservice using component tHttpRequest and i want this job to take a different path depending on the Http Status code received from the tHttpRequest.
Unfortunately i have been unable to capture the Http Status code even though it is displayed in the console.
I have attached a screenshot of my job.
Ideally the 2 if links would contain something like ?context.Http_Status_Code.equals(200)? and ?!context.Http_Status_Code.equas(200)?.
Do you have any idea on how to get this status code ?
Regards, Valentin
NB : I am working with 5.1
0683p000009MAuQ.jpg
Labels (2)
1 Reply
Anonymous
Not applicable
Author

Hi
Just an diea I did't try, check the 'write the response content to file' option to output the response to a file, and then read this file to extract the status code with regular expression or othey way, and store it to a context variable, String type or int type. About the expression of runIf link, something like:
context.Http_Status_Code==200 // for int type.
or
context.Http_Status_Code.equals("200") // for string type
Shong