mardi 18 juin 2019

Why does not golang allow people to customize HTTP status?

I need to customize the HTTP Status in a handler in my Web Server, but I found that golang doesn't seem to support completely custom HTTP Response.. For example:

w.WriteHeader(999)

the result:

enter image description here

the status code seems couldn't be modified.. but, I want to define my own status, like Bad Request: xxx.

Is there any good ideas? Thanks a lot!




Aucun commentaire:

Enregistrer un commentaire