Junior — Middle
What types of queries did you use in your previous position?
sobes.tech AI
Answer from AI
In Golang, when working with web services and APIs, the following types of requests are often used:
- GET — to retrieve data from the server.
- POST — to send data to the server, for example, when creating a resource.
- PUT — to update an existing resource.
- DELETE — to delete a resource.
Depending on the task, I used these HTTP methods with the net/http package to interact with REST APIs. For example, to send a POST request with a JSON body:
resp, err := http.Post(url, "application/json", bytes.NewBuffer(jsonData))
if err != nil {
// handle error
}
// work with resp
I also used GET requests to retrieve data and DELETE to remove resources.