Loading

How to preserve header case in an outbound HTTP request

Veröffentlichungsdatum: Mar 2, 2024
Lösung

SYMPTOM

Headers set in the HTTP request operation are sent as all lower-case regardless of the values set in the operation.

For example, the headers shown in the screenshot below will be converted to lower case by default.
User-added image

The HTTP Wire logs show that the headers are sent as lower case:
DEBUG 2022-08-08 16:14:22,580 [[httprequester].http.requester.HTTP_Request_configuration.01 SelectorRunner] [processor: httprequesterFlow/processors/1; event: c8527381-172c-11ed-9e56-88665a052364] org.mule.service.http.impl.service.HttpMessageLogger.http.requester.HTTP_Request_configuration: REQUESTER
GET /request HTTP/1.1
mspassword: password
msusername: Mule
x-correlation-id: c8527381-172c-11ed-9e56-88665a052364
Host: localhost:8082
User-Agent: AHC/1.0
Connection: keep-alive
Accept: */*
This may cause the request to fail if the endpoint is expecting case-sensitive headers.

CAUSE

This is the default behaviour of the HTTP connector.

SOLUTION

This behaviour can be changed by modifying the Preserve Headers Case parameter in the HTTP Request Configuration, as shown below:

User-added image
Nummer des Knowledge-Artikels

001122003

 
Laden
Salesforce Help | Article