How can I read a header value when publishing a RESTful service?

I have created a RESTful service, uploaded the swagger (snippet below). I was expecting to be able to access headers via $.Input.Data.Header.Authorization but I don’t see this in the Inputs. Is there something else that I need to do or have I configured the header incorrectly in swagger?

  parameters:
    - in: header
      name: Authorization
      type: string
      description: The authenticated token used to grant access to a resource
  responses:
    '200':

Hi pauljza,

Currently in Linx5’s RestWebService component, the only input data that can be accessed within the solution’s is the Query Parameters and the Body content, thus if you need access to the data, please define parameters in either of these two. You will not be able to access the Header details from within the Linx process itself.

Thanks Dawie, Is this something you would consider in future releases of the component?

For now I will make use of the query parameter but for consistency of APIs I’d be keen to implement certain parameters in the headers of REST messages.

Regards
Paul

Hi Paul,

Yes, we will be looking at the headers an also at updating the definitions to the latest OpenAPI 3.0.0 that was released a couple of weeks ago.

Best regards,
Dawie

1 Like