NHSDigital/integration-adaptor-mhs

The MHS adaptor does not work with additional content-type parameters

Closed this issue · 2 comments

  • Description
    The MHS outbound call does not work with additional content-type parameter. Currently, it only works with 'application/json', and does not work with 'application/json; charset=utf-8'. The extra parameter 'charset' is additional information to describe the payload more accurately and to help the server to decode the stream correctly. If the server implies the ability to process utf-8 encoding by default, it should accept the request with/without the charset parameter. If the server has the ability the process other encodings it should allow the charset parameter to be specified and documented somewhere.

  • Component
    MHS adaptor outbound.

  • Version
    None

  • Step to Reproduce
    make a call with any request (e.g with curl), with header content-type: application/json;charset=utf-8

  • Test Data
    Any data

  • Preconditions
    None

  • Environment
    currently in open Test,

  • Severity
    Low, as there is a workaround

  • Priority
    Not urgent

  • Expected Behavior
    The request should work with content-type: application/json;charset=utf-8

Hi @Kusnaditjung. Thanks for reporting this. Outbound only supports Content-Type with a value of application/json. You'll get a 415 - Unsupported content type if you try another value. This isn't reflected in the openapi doc for this, so we will update that. We'll create a ticket to get this resolved.

Hi, talking to Michael Martin this morning, the c# generated code for content-type originally is with the charset parameter and the call failed. Here I also found the link about the example GPconnect spec with charset. https://developer.nhs.uk/apis/gpconnect-0-7-2/accessrecord_use_case_retrieve_a_care_record_section.html. So seems that the NHSD not so restrictive about the extra parameter detailing the encoding scheme(the GPConnect spec only supports utf-8 encoding scheme and it allows the content type with or without charset parameter).

Hope this extra information can be useful for discussion.