When making requests with Go it is almost always necessary to check the code of the which is returned. Generally, if the status code is between 200 and 300 you can treat as successful. But anything except a 200-300 status, we often need to handle.
Go has many built methods to help us with this. For example, we can use http.StatusText() to convert the status code to it’s human readable name.



Source link

LEAVE A REPLY

Please enter your comment!
Please enter your name here