Setting a header 400 with custom description -- is this possible?

El cero

Can I set a custom text in a header HTTP/1.0, like this:

header("HTTP/1.0 400 Custom text for debugging);

instead of:

header("HTTP/1.0 400 Bad Request");

Could you tell me if it is valid?

Lemures

Yes you can. But...

The reason why error codes and error messages exist is that so we can apply some standards in order to simplify the communication. That's the idea of a protocol - standards and rules in a conversation.

Now if we think, why there are both error codes and error messages, it might be that the messages are just a description of the code, meaning that if you changed it (without changing the error code) it would probably do no harm.

Still, this only depends on those who are communicating not depending on the http message, but instead on the code.

Having said these, I would go for an extra header instead of modifying an existing one. Just set a new header field for debugging.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Setting custom header using HttpURLConnection

From Dev

Dropwizard - Setting a custom vary header

From Dev

Setting custom header using HttpURLConnection

From Dev

Dropwizard - Setting a custom vary header

From Dev

Setting custom header NAME with jQuery Ajax

From Dev

The $_SERVER variable is not setting my custom header

From Dev

Setting custom header on Spring RestTemplate GET call

From Dev

How to make custom header then image description belongs to that Header and same process is carry on in TableView

From Dev

Setting a custom header using BrowserMob-Proxy REST api

From Dev

python nosetests setting the test description

From Dev

Setting header of CheckboxTableViewer

From Dev

Restkit not setting header or cookies

From Dev

Setting header in the Http Request

From Dev

Is it possible to add description to qemu VMs?

From Dev

Is it possible to set custom status message (in utf-8) in http status header?

From Dev

Is it possible to set custom header for https-proxy-agent when using ws?

From Dev

Get magento header description in schema Product description in view.phtml

From Dev

Setting backgroundcolor not possible

From Dev

Facebook Send Call with Custom Description

From Dev

Gitolite 3 - Setting repo description (not authorized)

From Dev

Laravel Schema Builder, setting field description

From Dev

NUnit Parameterized tests: Setting the test description

From Dev

Setting content description for option menu android Talkback

From Dev

Change in VsCode the foreground color for the description of a setting

From Dev

Setting ViewBag meta description in Layout file

From Dev

Laravel Schema Builder, setting field description

From Dev

Error while setting UDF description in VBA

From Dev

Setting scaladoc header/footer in Gradle

From Dev

Setting Proper Header for Caching in PHP

Related Related

  1. 1

    Setting custom header using HttpURLConnection

  2. 2

    Dropwizard - Setting a custom vary header

  3. 3

    Setting custom header using HttpURLConnection

  4. 4

    Dropwizard - Setting a custom vary header

  5. 5

    Setting custom header NAME with jQuery Ajax

  6. 6

    The $_SERVER variable is not setting my custom header

  7. 7

    Setting custom header on Spring RestTemplate GET call

  8. 8

    How to make custom header then image description belongs to that Header and same process is carry on in TableView

  9. 9

    Setting a custom header using BrowserMob-Proxy REST api

  10. 10

    python nosetests setting the test description

  11. 11

    Setting header of CheckboxTableViewer

  12. 12

    Restkit not setting header or cookies

  13. 13

    Setting header in the Http Request

  14. 14

    Is it possible to add description to qemu VMs?

  15. 15

    Is it possible to set custom status message (in utf-8) in http status header?

  16. 16

    Is it possible to set custom header for https-proxy-agent when using ws?

  17. 17

    Get magento header description in schema Product description in view.phtml

  18. 18

    Setting backgroundcolor not possible

  19. 19

    Facebook Send Call with Custom Description

  20. 20

    Gitolite 3 - Setting repo description (not authorized)

  21. 21

    Laravel Schema Builder, setting field description

  22. 22

    NUnit Parameterized tests: Setting the test description

  23. 23

    Setting content description for option menu android Talkback

  24. 24

    Change in VsCode the foreground color for the description of a setting

  25. 25

    Setting ViewBag meta description in Layout file

  26. 26

    Laravel Schema Builder, setting field description

  27. 27

    Error while setting UDF description in VBA

  28. 28

    Setting scaladoc header/footer in Gradle

  29. 29

    Setting Proper Header for Caching in PHP

HotTag

Archive