API Connect

API Connect

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  how to restrict specific content-types in API Connect

    Posted Thu May 25, 2023 05:28 AM

    Hi All,

    here we are trying to restrict the API to allow request with content-type as "application/xml" and should reject all other request formats or content-type, we should set the status code as '415 Unsupported Media Type' when other than application/xml is received.

    how to achieve this without coding efforts, by default it is accepting all the request formats even when API have produces and consumes as "application/xml" and not generating 415 status code.

    Kindly help us to achieve this.



    ------------------------------
    Manasa G
    ------------------------------


  • 2.  RE: how to restrict specific content-types in API Connect

    Posted Fri May 26, 2023 03:27 AM

    Produces and consumes in the openapi document are for documentation purposes - they don't have any functional impact.
    If you want to reject other content types you would need to do so in your API assembly.



    ------------------------------
    Chris Dudley
    ------------------------------