Question: What is the correct way to pass this as a body of an HTTP POST request?

  1. resp, err := http.Post("https://httpbin.org/post", "text/plain", []byte(data))
  2. resp, err := http.Post("https://httpbin.org/post", "text/plain", data)
  3. resp, err := http.Post("https://httpbin.org/post", "text/plain", strings.NewReader(data))
  4. resp, err := http.Post("https://httpbin.org/post", "text/plain", &data)

Answer: The correct answer of the above question is Option C:resp, err := http.Post("https://httpbin.org/post", "text/plain", strings.NewReader(data))