standard-webhooks / standard-webhooks

The Standard Webhooks specification

Home Page:https://www.standardwebhooks.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

spec: Add `content-type` header

sudosubin opened this issue · comments

How about specifying the content-type of the webhook request in the spec?

I don't have a definite opinion on this, just a suggestion.

  • content-type: application/json
    • It is the most common and standard value.
  • content-type: application/vnd.standard-webhooks+json (such as application/vnd.go.cd.v1+json, application/vnd.github+json)
    • It follows vendor-specific MIME types.
    • Users can clearly understand that the webhook requests respect the standard-webhooks.
    • It is effective for gradually opt-in or switching from existing webhook consumer implementations. Through the content-type header, user can check whether it is a standard-webhook request and can perform additional authentication logic.
    • Some candidates:
      1. application/vnd.standard-webhooks+json
      2. application/vnd.standard-webhooks.v1+json
      3. application/vnd.standardwebhooks+json
      4. application/vnd.standardwebhooks.v1+json

I'm personnaly in favor of application/vnd.standard-webhooks.v1+json
If we introduce this; should the consumer refuse anything that doesn't use this mime type then?