Skip to content

Commit

Permalink
chore: update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
sigoden committed Jun 17, 2021
1 parent d95a98d commit dcc5e1f
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 70 deletions.
74 changes: 38 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Read this in other languages: [中文](./README.zh-CN.md)
- [Echo](#echo)
- [Http](#http)
- [Options](#options)
- [cookie](#cookie)
- [Cookies](#cookies)
- [x-www-form-urlencoded](#x-www-form-urlencoded)
- [multipart/form-data](#multipartform-data)
- [graphql](#graphql)
Expand Down Expand Up @@ -959,52 +959,54 @@ The `echo` client does not send any request, and directly returns the data in th
timeout: 0,
// `withCredentials` Whether to provide credentials
withCredentials: true,
// `maxRedirects` defines the maximum number of redirects to follow in node.js. If set to 0, no redirects will be followed.
// `maxRedirects` defines the maximum number of redirects to follow in node.js.
// If set to 0, no redirects will be followed.
maxRedirects: 0,
// `headers` is default request headers
headers: {
},
// `proxy` configures http(s) proxy, you can also use HTTP_PROXY, HTTPS_PROXY environment variables
// `proxy` configures http(s) proxy, you can also use HTTP_PROXY, HTTPS_PROXY
// environment variables
proxy: "http://user:pass@localhost:8080"
}
```

#### cookie
#### Cookies

```js
{
test1: {
req: {
url: "https://httpbin.org/cookies/set",
query: {
k1: "v1",
k2: "v2",
},
},
res: {
status: 302,
headers: { @partial
'set-cookie': [], @type
},
body: "", @type
}
},
test2: {
req: {
url: "https://httpbin.org/cookies",
headers: {
Cookie: `test1.res.headers["set-cookie"]`, @eval
}
},
res: {
body: { @partial
cookies: {
k1: "v1",
k2: "v2",
}
}
},
},
test1: {
req: {
url: "https://httpbin.org/cookies/set",
query: {
k1: "v1",
k2: "v2",
},
},
res: {
status: 302,
headers: { @partial
'set-cookie': [], @type
},
body: "", @type
}
},
test2: {
req: {
url: "https://httpbin.org/cookies",
headers: {
Cookie: `test1.res.headers["set-cookie"]`, @eval
}
},
res: {
body: { @partial
cookies: {
k1: "v1",
k2: "v2",
}
}
},
},
}
```

Expand Down
68 changes: 34 additions & 34 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Apitest 是一款使用类JSON的DSL编写测试用例的自动化测试工具
- [Echo](#echo)
- [Http](#http)
- [配置](#配置)
- [cookie](#cookie)
- [Cookies](#cookies)
- [x-www-form-urlencoded](#x-www-form-urlencoded)
- [multipart/form-data](#multipartform-data)
- [graphql](#graphql)
Expand Down Expand Up @@ -958,42 +958,42 @@ Apitest 提供两种客户端。
}
```

#### cookie
#### Cookies

```
{
test1: {
req: {
url: "https://httpbin.org/cookies/set",
query: {
k1: "v1",
k2: "v2",
},
},
res: {
status: 302,
headers: { @partial
'set-cookie': [], @type
},
body: "", @type
}
},
test2: {
req: {
url: "https://httpbin.org/cookies",
headers: {
Cookie: `test1.res.headers["set-cookie"]`, @eval
}
},
res: {
body: { @partial
cookies: {
k1: "v1",
k2: "v2",
}
}
},
},
test1: {
req: {
url: "https://httpbin.org/cookies/set",
query: {
k1: "v1",
k2: "v2",
},
},
res: {
status: 302,
headers: { @partial
'set-cookie': [], @type
},
body: "", @type
}
},
test2: {
req: {
url: "https://httpbin.org/cookies",
headers: {
Cookie: `test1.res.headers["set-cookie"]`, @eval
}
},
res: {
body: { @partial
cookies: {
k1: "v1",
k2: "v2",
}
}
},
},
}
```

Expand Down

0 comments on commit dcc5e1f

Please sign in to comment.