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

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
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)
2 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 👍