1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-08 22:52:29 +08:00

doc: format code in doc file

This commit is contained in:
dudaodong
2023-06-13 15:08:40 +08:00
parent 1e5b69e9bf
commit 69a797f8ed
8 changed files with 81 additions and 81 deletions

View File

@@ -658,24 +658,24 @@ import (
func main() {
url := "https://jsonplaceholder.typicode.com/todos"
header := map[string]string{
"Content-Type": "application/x-www-form-urlencoded",
// "Content-Type": "multipart/form-data",
}
"Content-Type": "application/x-www-form-urlencoded",
// "Content-Type": "multipart/form-data",
}
postData := url.Values{}
postData.Add("userId", "1")
postData.Add("title", "TestToDo")
postData := url.Values{}
postData.Add("userId", "1")
postData.Add("title", "TestToDo")
// postData := make(map[string]string)
// postData["userId"] = "1"
// postData["title"] = "title"
// postData := make(map[string]string)
// postData["userId"] = "1"
// postData["title"] = "title"
resp, err := netutil.HttpPost(apiUrl, header, nil, postData)
if err != nil {
log.Fatal(err)
}
body, _ := io.ReadAll(resp.Body)
t.Log("response: ", resp.StatusCode, string(body))
resp, err := netutil.HttpPost(apiUrl, header, nil, postData)
if err != nil {
log.Fatal(err)
}
body, _ := io.ReadAll(resp.Body)
t.Log("response: ", resp.StatusCode, string(body))
}
```