How to specify request headers in API Blueprint
Asked Answered
T

1

6

I am trying to define an API blueprint for a resource that utilises request headers to understand what content type to return.

## Offer [/offers/{offerCode}]

+ Parameters
    + offerCode: summer2015 (required, string) - alphanumeric offer code

### View an Offer Detail [GET]

+ Response 200 (application/vnd.v0.1.0+json)

    {
        ........
    }

I want my request to be as follows:-

GET /offers/summer2015 HTTP/1.1
Host: my.api.com
Accept: application/vnd.v0.1.0+json

How can I document that using API Blueprint?

Topee answered 13/5, 2015 at 9:3 Comment(0)
A
15

I'm not sure if I understand what you want to achieve but I'd say that you want to specify header for request and you can do that by specifying request the same way as response.

## Offer [/offers/{offerCode}]

+ Parameters
    + offerCode: summer2015 (required, string) - alphanumeric offer code


### View an Offer Detail [GET]

+ Request 

    + Headers 

          Accept: application/vnd.v0.1.0+json 


+ Response 200 (application/vnd.v0.1.0+json)

    {
        ........
    }
Allahabad answered 13/5, 2015 at 11:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.