Parsing JSON Request Body & Return JSON Response With Golang
Edward Pie

Thanks Edward Pie for response. I’ve traced some code for request body by using httputil.DumpRequest.

When I send raw data, request body is:

“Username”: “avinash”,
“password”: “pasd”,
“IsAdmin”: true

And I can able to decode it into map[string]interface{}. But when I send form data in the request, request body is:

— — — WebKitFormBoundaryQLIHXcrBk6kj5Gd5
Content-Disposition: form-data; name=”Username”

 — — — WebKitFormBoundaryQLIHXcrBk6kj5Gd5
Content-Disposition: form-data; name=”Password”

 — — — WebKitFormBoundaryQLIHXcrBk6kj5Gd5
Content-Disposition: form-data; name=”IsAdmin”

 — — — WebKitFormBoundaryQLIHXcrBk6kj5Gd5 —

And I am getting panic for decoding. Not sure, where I am getting wrong.