cancel
Showing results for 
Search instead for 
Did you mean: 

CL_HTTP_CLIENT Header Uppercase Error REST

Daniel_Ramirez
Explorer
0 Kudos

Hi ,

I'm trying to consume a API REST from SAP . The web service request as header "efacturaAuthorizationToken" , with the capital letters between word.

I set the header as follows

lo_http_client->request->if_http_entity~set_header_fields(
                          VALUE #(
                             ( name  = 'efacturaAuthorizationToken'
                               value = 'XXXXXXXXXXXXXXXXXXXXXXXXXX' )
                             ( name  = 'Content-Type'
                               value = 'text/plain'  ) ) ).

SAP get this value in lower letter

When I consume the service, the API's response return that this header's value was not send. The API get this value all in low letter. Is there some way where I can send the values with some letters in capital ?

Thank

Accepted Solutions (1)

Accepted Solutions (1)

Andre_Fischer
Product and Topic Expert
Product and Topic Expert

The API that you are calling is not following the standards.

In this discussion in stackoverflow I found the following link to the RFC 7230 that states: "Each header field consists of a case-insensitive field name followed by a colon (":"),

https://tools.ietf.org/html/rfc7230#section-3.2

So the consumer should be able to handle a header in lowercase letters.

Daniel_Ramirez
Explorer
0 Kudos

Hi ,

Thank for your answer.

So , There isn't some way Sap can send that header in uppercase, some configuration ?

Is it obligatory that the web service receive the header in lowercase ?

Thanks ....

Answers (1)

Answers (1)

Andre_Fischer
Product and Topic Expert
Product and Topic Expert

It is not obligatory that the web service receives the http header in lowercase.

But as I wrote the web service client should be able to handle a http header if it send by the server in lowercase because http header field names are supposed to be case insensitive.

The SAP Gateway framework does however not offer you a means to send http header names in uppercase.