diff --git a/ytest/README.md b/ytest/README.md index 5bc29ac..5651a69 100644 --- a/ytest/README.md +++ b/ytest/README.md @@ -140,7 +140,9 @@ match { // assert resp.body.id == id host ``` -The Host directive allows you to use an abstract domain name (which does not necessarily exist) to represent a service. For examples: +The Host directive allows you to use an abstract domain name (which does not necessarily exist) to represent a service. + +For examples: ```go host "https://foo.com", "http://127.0.0.1:8080" @@ -153,17 +155,18 @@ host "https://foo.com", ${FOO_HOST} // Let env FOO_HOST point to the test environment or production environment ``` -## auth + +## req/post/get/delete/put TODO -## req/post/get/delete/put +## header TODO -## header +## ret TODO @@ -173,7 +176,30 @@ TODO TODO -## ret +## auth -TODO +```go +auth +``` +Auth sets an Authorization for a request. For example: + +```go +auth qiniu("", "") +``` + +Authorization information can be shared between different requests: + +```go +testauth := qiniu("", "") + +post "https://foo.com/bar" +auth testauth +ret 200 + +... + +get "https://foo.com/bar" +auth testauth +ret 200 +```