Go Package net/http: Difference between revisions
Jump to navigation
Jump to search
Line 16: | Line 16: | ||
* Working example in ovidiu-feodorov/go-micros/blob/develop/metadata/internal/handler/http/http.go | * Working example in ovidiu-feodorov/go-micros/blob/develop/metadata/internal/handler/http/http.go | ||
* [[JSON_in_Go#With_a_Reader]] | * [[JSON_in_Go#With_a_Reader]] | ||
Decoding to JSON only works if the HTTP requests has a "Content-Type: application/json" header, otherwise the decoding fails with an EOF error. | |||
</font> | </font> |
Revision as of 20:20, 16 October 2023
External
Internal
Overview
Reading the Request Body
TO PROCESS:
- https://www.alexedwards.net/blog/how-to-properly-parse-a-json-request-body
- Working example in ovidiu-feodorov/go-micros/blob/develop/metadata/internal/handler/http/http.go
- JSON_in_Go#With_a_Reader
Decoding to JSON only works if the HTTP requests has a "Content-Type: application/json" header, otherwise the decoding fails with an EOF error.