#Query
3 articles
06 How to Used Response Code in Golang
Introduction to Response Codes
Something we also need to know about HTTP is the response code. This is a representation of the response code, where from this code we can see whether a request we sent from the client was successfully processed by the server or failed to be processed by the server. So there are lots of response codes that we can use when creating a website. You can immediately look in more depth at several HTTP Status Codes here https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
05 How to Used Request Form Post in Golang
Introduction to Post Forms
Similar to the previous post, when we use the GET method, the results of all the data in the form will be a param query, whereas if we use POST then all the data in the form is sent via the body of the HTTP Request, only the method is different. All form post data sent from the client will automatically be stored in the Request.PostFrom
attribute. However, before we can retrieve the PostForm attribute data, we must first call the Request.ParseForm()
method and then this method will be used to parse the body. Parsing this data will produce form data, if it is not there it will cause an error in the parsing.
03 How To Used Query Parameter in Golang
Introduction to Query Parameters
Query parameters are one of the features of http that we usually use to send data from the client to the server. This parameter query is placed in the URL of the endpoint that we have created. To add query parameters, we can use ?=name=value
in our website URL.