Go Package net/http: Difference between revisions
Jump to navigation
Jump to search
(7 intermediate revisions by the same user not shown) | |||
Line 4: | Line 4: | ||
=Internal= | =Internal= | ||
* [[Go_Language_Modularization#net_http|Standard Library]] | * [[Go_Language_Modularization#net_http|Standard Library]] | ||
* [[HTTP_in_Go#Overview|HTTP in Go]] | |||
=Overview= | =Overview= | ||
=Reading the Request Body= | |||
<font color=darkkhaki> | |||
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. | |||
</font> | |||
=Registering Handlers Generated by oapi-codegen from an OpenAPI Specification= | |||
{{Internal|Oapi-codegen#chi-server|<tt>oapi-codegen</tt> Server Code Generation}} |
Latest revision as of 21:50, 26 January 2024
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.