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

Announcements
Q&A with Qlik - Qlik Cloud Migration: Questions about migrating to Qlik Cloud? Catch the latest replay!
cancel
Showing results for 
Search instead for 
Did you mean: 
anyxs
Contributor II
Contributor II

403 Forbidden error with tHttpClient

Hi,

I am trying to send a multipart/form-data POST request using tHTTPClient to the 123Paie API to import absences.

The same request works perfectly in Bruno (200 OK) with the following body:

- id: {{token}} (session token obtained from a previous login call)
- appli: STD
- pto: upload_absences_std
- date: 122025
- filename: 260429Absences.txt
- charset: ISO8859-15
- file: @file(260429Absences.txt)

In Bruno, no Cookie or JSESSIONID is needed — just the token in the body.

In Talend, I configured tHTTPClient as follows:
- Method: POST
- Body: Form data (multipart)
- Parameters in body: id, appli, pto, date, filename, charset
- File attachment: file = 260429Absences.txt (application/octet-stream, ISO8859-15)
- Token retrieved correctly via globalMap (confirmed with System.out.println)

However, I always get a 403 Forbidden error.

Things I have already tried:
- Passing parameters as query string instead of body
- Adding Cookie header with JSESSIONID
- Using cookies file
- Checking token value before the call (correct)

Is there something specific about how tHTTPClient handles multipart/form-data that could cause a 403? Could it be related to the HTTP version (currently HTTP/2)?

Thank you!

Labels (2)
4 Replies
Rahul_Kale
Support
Support

Hello anyxs,

 

Thank you for reaching out to the Qlik community.
 

Yes, it’s very likely how the HTTPClient builds the multipart request, especially headers/boundary/encoding or HTTP version.
 

Could you please try these most important fixes:
 

  1. Force HTTP/1.1 (not HTTP/2)
  2. Set charset → ISO-8859-15
  3. File MIME → text/plain (not application/octet-stream)
  4. Disable Expect: 100-continue
  5. Ensure field order: params → then file
     

If still failing: Talend multipart ≠ Bruno → use tRESTClient or custom HttpClient.

anyxs
Contributor II
Contributor II
Author

Thanks for your suggestions.

I’ve already tested all of the following:

  • Forced HTTP/1.1 (not HTTP/2)
  • Charset correctly set to ISO-8859-15
  • File MIME type set to text/plain (instead of application/octet-stream)
  • Disabled Expect: 100-continue
  • Ensured correct field order (parameters first, then file)

Despite all this, I still consistently get a 403 Forbidden response.

I also tried using tRestClient instead of tHTTPClient, but the result is the same.


At this point, I will move forward with a custom HttpClient implementation to replicate the curl request more precisely.


Thanks 👍

Rahul_Kale
Support
Support

Sure anyxs, 

 

In case of anything, please be sure to let us know. We are more than happy to assist you.

anyxs
Contributor II
Contributor II
Author

Thank you Rahul_Kale, 


I ended up choosing the solution of manually building a multipart body and passing it as plain text in the request body.