Niko
Niko

Reputation: 26730

Correct HTTP Status Code when rejecting a request because User-Agent header is invalid

I'm currently working on an HTTP based API. Our terms of use require the user to send an appropriate user-agent header (e.g. "-" is considered invalid). Now I'm not quite sure which would be the correct HTTP status the server should be responding with, if the request is rejected. Any suggestions?

Upvotes: 5

Views: 7434

Answers (1)

Malcolm Box
Malcolm Box

Reputation: 4036

400 Bad Request or 403 Forbidden would be the two I'd pick

Upvotes: 6

Related Questions