-
Notifications
You must be signed in to change notification settings - Fork 506
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
74 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -191,6 +191,7 @@ HTTP 200 | |
* [Templating a JSON Body](#templating-a-json-body) | ||
* [Templating a XML Body](#templating-a-xml-body) | ||
* [Using GraphQL Query](#using-graphql-query) | ||
* [Using Dynamic Datas](#using-dynamic-datas) | ||
* [Testing Response](#testing-response) | ||
* [Testing Status Code](#testing-status-code) | ||
* [Testing Response Headers](#testing-response-headers) | ||
|
@@ -586,6 +587,32 @@ GraphQL queries can also use [Hurl templates]. | |
|
||
[Doc](https://hurl.dev/docs/request.html#graphql-body) | ||
|
||
### Using Dynamic Datas | ||
|
||
[Functions] like `newUuid` and `newDate` can be used in templates to create dynamic datas: | ||
|
||
|
||
A file that creates a dynamic email (i.e `[email protected]`): | ||
|
||
```hurl | ||
POST https://example.org/api/foo | ||
{ | ||
"name": "foo", | ||
"email": "{{newUuid}}@test.com" | ||
} | ||
``` | ||
|
||
A file that creates a dynamic query parameter (i.e `2024-12-02T10:35:44.461731Z`): | ||
|
||
```hurl | ||
GET https://example.org/api/foo | ||
[QueryStringParams] | ||
date: {{newDate}} | ||
HTTP 200 | ||
``` | ||
|
||
[Doc](https://hurl.dev/docs/templates.html#functions) | ||
|
||
## Testing Response | ||
|
||
Responses are optional, everything after `HTTP` is part of the response asserts. | ||
|
@@ -1524,9 +1551,9 @@ Please follow the [contrib on Windows section]. | |
[GitHub]: https://github.com/Orange-OpenSource/hurl | ||
[libcurl]: https://curl.se/libcurl/ | ||
[star Hurl on GitHub]: https://github.com/Orange-OpenSource/hurl/stargazers | ||
[HTML]: /docs/standalone/hurl-5.0.1.html | ||
[PDF]: /docs/standalone/hurl-5.0.1.pdf | ||
[Markdown]: /docs/standalone/hurl-5.0.1.md | ||
[HTML]: /docs/standalone/hurl-6.0.0.html | ||
[PDF]: /docs/standalone/hurl-6.0.0.pdf | ||
[Markdown]: /docs/standalone/hurl-6.0.0.md | ||
[JSON body]: https://hurl.dev/docs/request.html#json-body | ||
[XML body]: https://hurl.dev/docs/request.html#xml-body | ||
[XML multiline string body]: https://hurl.dev/docs/request.html#multiline-string-body | ||
|
@@ -1548,6 +1575,7 @@ Please follow the [contrib on Windows section]. | |
[`--json` option]: https://hurl.dev/docs/manual.html#json | ||
[`--resolve`]: https://hurl.dev/docs/manual.html#resolve | ||
[`--connect-to`]: https://hurl.dev/docs/manual.html#connect-to | ||
[Functions]: https://hurl.dev/docs/templates.html#functions | ||
[GitHub]: https://github.com/Orange-OpenSource/hurl | ||
[Hurl latest GitHub release]: https://github.com/Orange-OpenSource/hurl/releases/latest | ||
[Visual C++ Redistributable Package]: https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170#latest-microsoft-visual-c-redistributable-version | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -191,6 +191,7 @@ HTTP 200 | |
* [Templating a JSON Body](#templating-a-json-body) | ||
* [Templating a XML Body](#templating-a-xml-body) | ||
* [Using GraphQL Query](#using-graphql-query) | ||
* [Using Dynamic Datas](#using-dynamic-datas) | ||
* [Testing Response](#testing-response) | ||
* [Testing Status Code](#testing-status-code) | ||
* [Testing Response Headers](#testing-response-headers) | ||
|
@@ -586,6 +587,32 @@ GraphQL queries can also use [Hurl templates]. | |
|
||
[Doc](https://hurl.dev/docs/request.html#graphql-body) | ||
|
||
### Using Dynamic Datas | ||
|
||
[Functions] like `newUuid` and `newDate` can be used in templates to create dynamic datas: | ||
|
||
|
||
A file that creates a dynamic email (i.e `[email protected]`): | ||
|
||
```hurl | ||
POST https://example.org/api/foo | ||
{ | ||
"name": "foo", | ||
"email": "{{newUuid}}@test.com" | ||
} | ||
``` | ||
|
||
A file that creates a dynamic query parameter (i.e `2024-12-02T10:35:44.461731Z`): | ||
|
||
```hurl | ||
GET https://example.org/api/foo | ||
[QueryStringParams] | ||
date: {{newDate}} | ||
HTTP 200 | ||
``` | ||
|
||
[Doc](https://hurl.dev/docs/templates.html#functions) | ||
|
||
## Testing Response | ||
|
||
Responses are optional, everything after `HTTP` is part of the response asserts. | ||
|
@@ -1524,9 +1551,9 @@ Please follow the [contrib on Windows section]. | |
[GitHub]: https://github.com/Orange-OpenSource/hurl | ||
[libcurl]: https://curl.se/libcurl/ | ||
[star Hurl on GitHub]: https://github.com/Orange-OpenSource/hurl/stargazers | ||
[HTML]: https://hurl.dev/assets/docs/hurl-5.0.1.html.gz | ||
[PDF]: https://hurl.dev/assets/docs/hurl-5.0.1.pdf.gz | ||
[Markdown]: https://hurl.dev/assets/docs/hurl-5.0.1.md.gz | ||
[HTML]: https://hurl.dev/assets/docs/hurl-6.0.0.html.gz | ||
[PDF]: https://hurl.dev/assets/docs/hurl-6.0.0.pdf.gz | ||
[Markdown]: https://hurl.dev/assets/docs/hurl-6.0.0.md.gz | ||
[JSON body]: https://hurl.dev/docs/request.html#json-body | ||
[XML body]: https://hurl.dev/docs/request.html#xml-body | ||
[XML multiline string body]: https://hurl.dev/docs/request.html#multiline-string-body | ||
|
@@ -1548,6 +1575,7 @@ Please follow the [contrib on Windows section]. | |
[`--json` option]: https://hurl.dev/docs/manual.html#json | ||
[`--resolve`]: https://hurl.dev/docs/manual.html#resolve | ||
[`--connect-to`]: https://hurl.dev/docs/manual.html#connect-to | ||
[Functions]: https://hurl.dev/docs/templates.html#functions | ||
[GitHub]: https://github.com/Orange-OpenSource/hurl | ||
[Hurl latest GitHub release]: https://github.com/Orange-OpenSource/hurl/releases/latest | ||
[Visual C++ Redistributable Package]: https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170#latest-microsoft-visual-c-redistributable-version | ||
|