func documentation(rw http.ResponseWriter, r *http.Request) {
data := []URLDescription{
{
URL: "/",
Method: "GET",
Description: "See Documentation",
},
}
b, err := json.Marshal(data)
utils.HandelErr(err)
fmt.Fprintf(rw, "%s", b)
}
func documentation(rw http.ResponseWriter, r *http.Request) {
data := []URLDescription{
{
URL: "/",
Method: "GET",
Description: "See Documentation",
},
}
rw.Header().Add("Content-Type", "application/json")
b, err := json.Marshal(data)
utils.HandleErr(err)
fmt.Fprintf(rw, "%s", b)
}
func documentation(rw http.ResponseWriter, r *http.Request) {
data := []URLDescription{
{
URL: "/",
Method: "GET",
Description: "See Documentation",
},
}
rw.Header().Add("Content-Type", "application/json")
json.NewEncoder(rw).Encode(data)
}
type URLDescription struct {
URL string
method string
Description string
}
func documentation(rw http.ResponseWriter, r *http.Request) {
data := []URLDescription{
{
URL: "/",
method: "GET",
Description: "See Documentation",
},
}
rw.Header().Add("Content-Type", "application/json")
json.NewEncoder(rw).Encode(data)
}
type URLDescription struct {
URL string `json:"url"`
Method string `json:"method"`
Description string `json:"description"`
}
type URLDescription struct {
URL string `json:"url"`
Method string `json:"method"`
Description string `json:"description"`
Payload string `json:"payload,omitempty"`
}
{
URL: "/",
Method: "GET",
Description: "See Documentation",
},
{
URL: "/blocks",
Method: "POST",
Description: "Add A Block",
Payload: "data:string",
},
type URLDescription struct {
URL string `json:"url"`
Method string `json:"method"`
Description string `json:"description"`
Payload string `json:"payload"`
}
[Nomad Coin] Rest API - #6.2 MarshalText (0) | 2022.07.20 |
---|---|
[Nomad Coin] Rest API - #6.0 Setup (0) | 2022.07.19 |
[Nomad Coin] Explorer - #5.6 Recap (0) | 2022.07.18 |
[Nomad Coin] Explorer - #5.5 Refactoring (0) | 2022.07.18 |
[Nomad Coin] Explorer - #5.4 Adding A Block (0) | 2022.07.18 |
댓글 영역