Go Web Development

Check your knowledge of building web servers and REST APIs using Go’s net/http package.

1. Which package provides core HTTP server and client functionality in Go?
2. What is the default HTTP multiplexer (router) in Go's net/http package?
3. Which function is used to start an HTTP server on a specified address in Go?
4. What is the signature of the function passed to http.HandleFunc?
5. Which HTTP status code is returned by http.StatusNotFound?
6. What does the http.Request struct represent in Go?
7. Which method is used to extract query parameters from an http.Request?
8. What is the return type of the http.Get function?
9. Which function is used to parse form data from a POST request in http.Request?
10. What is the default port when calling http.ListenAndServe with address ":8080"?
11. Which of the following are valid middleware patterns in Go web development?
12. Which of these functions/approaches can send JSON responses in Go?
13. Which of the following are popular third-party routers for Go web development (beyond the default ServeMux)?
14. Which methods are part of the http.Handler interface?
15. The http.ResponseWriter interface includes a WriteHeader method to set the HTTP status code.
16. Goroutines cannot be used within HTTP handlers to process requests concurrently.
17. The context package is used to manage request-scoped values, cancellation, and timeouts in Go web applications.
18. What is the full import path of the standard library package used for server-side HTML templating in Go?
19. Name the method chain used to set a response header (e.g., Content-Type) in http.ResponseWriter. (format: Method1().Method2)
20. What is the default Content-Type header value when using http.ResponseWriter.Write with a plain string?
Answered 0 of 0 — 0 correct