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

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

How to make Post request using tRestrequest component

Hi,

 

I have one API and url is looks like this "https://mycontent.com/v2/tokens"

 

And when I use this postman I use below configuration

 

Method: POST

 

Headers

Content-Type: application/x-www-form-urlencoded

 

Body:

Check option: x-www-form-urlencoded

 

Parameters added

Username:abc

Password:abc

Department:Finance

 

It gives me XML response.

 

I have seen all posts on Talend forum but no one could help me to setup like this.

 

May I know please how can I set up these configuration in trestrequest and get a response ?

 

Thanks

Labels (5)
5 Replies
Anonymous
Not applicable
Author

tRESTRequest does not respond, the response comes from tRESTResponse.

You need always both components!

You can have more than one tRESTResponse but only one is allowed to answer per request.

This way you can send different responses (normal output or error response but you could also use only one tRESTResponse and handle all different responses with only this one. 

Anonymous
Not applicable
Author

Hi Jan

 

Thanks for the response.

 

Actually my API response with HTTPS only and it gives proper response when I test with Postman. But when I do with HTTPS in trestrequest it shows error like this 

 

"Caused by: java.lang.RuntimeException: Protocol mismatch for port -1: engine's protocol is http, the url protocol is https"

 

Here is my configuration but still gets error, Could you please have a look where am doing wrong ?

 

0683p000009LrIU.png0683p000009LrtY.png

 

And When I do with HTTP only I'm getting error like this

 

"Cannot assign requested address: bind
java.net.BindException: Cannot assign requested address: bind"

 

Dont know why but its works from Postman. And where I need to set content-type in tRestrequest Jan ?

 

May I know please how can I make it work ?

 

 


requestschema.png
Anonymous
Not applicable
Author

Of course. This is correct. You have to activate https in the runtime container or you have to add a forward proxy which enforces encryption.

Anonymous
Not applicable
Author

Hi Jan

Its working absolutely fine with tRest component with POST.  Then why its not working with tRestrequest ?

 

But Like you said "You have to activate https in the runtime container or you have to add a forward proxy which enforces encryption"

 

Where I need to look for to enable these setting ? Is it in Talend or somewhere else ? Because like I said my API gives response with HTTPS in POSTMAN, so where I'm missing ?

Anonymous
Not applicable
Author

Any suggestion please ? Or its a BUG ?