1

I just stumbled across this question:

Is it still an acceptable thing to use custom header fields and if yes how should they be named?

As far as i knew custom fields start with an X-.. but according to RFC 6648 these are depricated since 2012 but I also haven't found any proposals for alternatives from them.

So would it make sense to name custom fields just "normal" (without an X-Prefix)? Does it makes sense at all to use custom fields for exchanging additional information?

Benjamin
  • 1,067
  • 20
  • 30

1 Answers1

3

Just name them normally. See, e.g., Custom HTTP headers : naming conventions

Whether it makes sense to use them depends on the application. They can certainly be used for things done in middleware such as authentication tokens, for example.

If there is something you really want checked by the server before it spins off endpoint-specific data processing code, the headers aren't a terrible place to put the relevant data.

Community
  • 1
  • 1
Tom
  • 939
  • 5
  • 9