Uploaded image for project: 'edge-rtac'
  1. edge-rtac
  2. EDGRTAC-16

Honor the Accept header



    • Story
    • Status: Closed (View Workflow)
    • P2
    • Resolution: Done
    • None
    • 2.1.0
    • None
    • Core: F - Sprint 101, Core: F - Sprint 102, Core: F - Sprint 103, Prokopovych - Sprint 104
    • 3
    • Prokopovych



      Currently the edge rtac API always returns XML. Honoring the accept header for at least application/json will make it easier for external systems to consume this service.

      Really, this means that if the accept header is request application/json, we just return the json response obtained from mod-rtac, instead of converting it to XML.
      Any other value specified in the accept header would result in XML, including if the accept header is omitted altogether.

      • If accept header equals '*/*' or 'application/xml' or isn't specified, then response returns xml
      • If accept header equals 'application/json', then response returns json
      • Inappropriate accept headers (such as image/* or even application/*) should result in HTTP 406 Unacceptable status

      Acceptance Criteria

      • The service an return either xml or json based upon the request's accept header
      • HTTP 406 error is returned in case of inappropriate accept headers specified in request
      • Unit tests are updated
      • API tests are updated.


      1. Scenario – return XML
      • Given request to edge-rtac
      • When Accept header in request equals / or includes application/xml or is empty
      • Then response is returned in XML format
      2. Scenario – return JSON
      • Given request to edge-rtac
      • When Accept header in request includes application/json
      • And application/xml isn’t included in Accept header
      • Then response is returned in JSON format
      3. Scenario – return HTTP 406 status
      • Given request to edge-rtac
      • When Accept header in request doesn’t include application/json or application/xml
      • And Accept header doesn’t equal '*/*'
      • And Accept header isn’t empty
      • Then return HTTP 406 error status instead of response

      TestRail: Results


          Issue Links



                oyatsenko Oleksandr Yatsenko
                cmcnally Craig McNally
                0 Vote for this issue
                3 Start watching this issue



                  TestRail: Runs

                    TestRail: Cases