spec: Add `content-type` header
sudosubin opened this issue · comments
Subin Kim commented
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 asapplication/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:
application/vnd.standard-webhooks+json
application/vnd.standard-webhooks.v1+json
application/vnd.standardwebhooks+json
application/vnd.standardwebhooks.v1+json
Vìncent Le Goff commented
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?