Skip to Content

CL_HTTP_CLIENT Header Uppercase Error REST

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

Header_Request

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Oct 17, 2019 at 02:03 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 28, 2019 at 07:54 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.