Added Guzzle extra options to README
This commit is contained in:
parent
d2cee79266
commit
4834dc3949
50
README.md
50
README.md
|
@ -33,20 +33,37 @@ To configure HTTP request you have to code your custom JSON file. You can start
|
||||||
```json
|
```json
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"url": "http://localhost/mysite/login",
|
"url": "http://localhost/mysite/",
|
||||||
"method": "POST",
|
"method": "GET",
|
||||||
"headers": null,
|
"headers": null,
|
||||||
"body": "username=admin&password=s3cr3t",
|
"body": null,
|
||||||
"header-regexp": [
|
"header-regexp": [
|
||||||
{
|
|
||||||
"next_url": "/Location: (.+?)$/"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"cookie": "/Set-Cookie: (.+?)$/"
|
"cookie": "/Set-Cookie: (.+?)$/"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"body-regexp": null
|
"body-regexp": null
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"url": "http://localhost/mysite/",
|
||||||
|
"method": "POST",
|
||||||
|
"headers": {
|
||||||
|
"Cookie": "§cookie§",
|
||||||
|
"Content-Type": "application/x-www-form-urlencoded"
|
||||||
|
},
|
||||||
|
"body": "username=admin&password=s3cr3t",
|
||||||
|
"header-regexp": [
|
||||||
|
{
|
||||||
|
"next_url": "/Location: (.+)/"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"body-regexp": null,
|
||||||
|
"extra_guzzle_options": [
|
||||||
|
{
|
||||||
|
"allow_redirects": false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"url": "http://localhost§next_url§",
|
"url": "http://localhost§next_url§",
|
||||||
"method": "GET",
|
"method": "GET",
|
||||||
|
@ -57,19 +74,27 @@ To configure HTTP request you have to code your custom JSON file. You can start
|
||||||
"header-regexp": null,
|
"header-regexp": null,
|
||||||
"body-regexp": [
|
"body-regexp": [
|
||||||
{
|
{
|
||||||
"email": "/<p>Your email is: (.+?)<\\/p>/"
|
"email": "/<p>Your email is (.+)!<\\/p>/"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "http://localhost/mysite/sign-up",
|
"url": "http://localhost§next_url§?email=§email§",
|
||||||
"method": "POST",
|
"method": "GET",
|
||||||
"headers": {
|
"headers": {
|
||||||
"Cookie": "§cookie§"
|
"Cookie": "§cookie§"
|
||||||
},
|
},
|
||||||
"body": "op=signup&email=§email§",
|
"body": null,
|
||||||
"header-regexp": null,
|
"header-regexp": [
|
||||||
"body-regexp": null
|
{
|
||||||
|
"flag1": "/Set-Cookie: flag2=(.+?);/"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"body-regexp": [
|
||||||
|
{
|
||||||
|
"flag2": "/<p>Congratulations, the flag is: (.+?)<\\/p>/"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
@ -81,6 +106,7 @@ Every JSON object is an HTTP request with specific parameters:
|
||||||
- **body**: the body of the request in case you send a POST request
|
- **body**: the body of the request in case you send a POST request
|
||||||
- **header-regexp**: an array of regular expressions you want to use to extract values from the headers. IMPORTANT: only the first value per regexp will be matched
|
- **header-regexp**: an array of regular expressions you want to use to extract values from the headers. IMPORTANT: only the first value per regexp will be matched
|
||||||
- **body-regexp**: like header-regexp, but the values will be matched against the response body
|
- **body-regexp**: like header-regexp, but the values will be matched against the response body
|
||||||
|
- **extra_guzzle_options**: array of extra Guzzle options. Here you can find a full list of options: https://docs.guzzlephp.org/en/stable/request-options.html
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue