
Contributor III
2019-04-11
01:38 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to POST www-form-urlencoded body with talend httpService
Hi everybody!
Can you help me, I would like to use standard
org.talend.sdk.component.api.service.http.HttpClient
to submit POST request to an endpoint.
I see example where body in JsonObject:
Is there way to configure HttpClient to post www-form-urlencoded parameters in request body.
Thank you very much!
584 Views
1 Solution
Accepted Solutions

Contributor III
2019-04-12
05:02 AM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes it is... I took closer look at
org.talend.sdk.component.runtime.manager.service.http.RequestParser#parse
and concluded my method could be like this
@Codec(encoder = {XWWWFormURLEncoder.class}) @Request(method = "POST", path = "/o/oauth2/token") public Response<JsonObject> getAccessToken( @Header("Content-Type") String contentType, OAuthDataStore oAuthDataStore);
where I had to add own body encoder implementation.
Fortunately Talend has good documentation and fluent lambda style code so to figure out this wasn't trouble at all.
584 Views
1 Reply

Contributor III
2019-04-12
05:02 AM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes it is... I took closer look at
org.talend.sdk.component.runtime.manager.service.http.RequestParser#parse
and concluded my method could be like this
@Codec(encoder = {XWWWFormURLEncoder.class}) @Request(method = "POST", path = "/o/oauth2/token") public Response<JsonObject> getAccessToken( @Header("Content-Type") String contentType, OAuthDataStore oAuthDataStore);
where I had to add own body encoder implementation.
Fortunately Talend has good documentation and fluent lambda style code so to figure out this wasn't trouble at all.
585 Views
