<picture>
<source media="(prefers-color-scheme: light)" srcset="/docs/assets/img/logo-light.svg?sanitize=true" >
<source media="(prefers-color-scheme: dark)" srcset="/docs/assets/img/logo-dark.svg?sanitize=true" >
<img src="/docs/assets/img/logo-light.svg?sanitize=true" width="264px" alt="Hurl Logo">
</picture>
[![deploy status](https://github.com/Orange-OpenSource/hurl/workflows/test/badge.svg)](https://github.com/Orange-OpenSource/hurl/actions)
[![coverage](https://Orange-OpenSource.github.io/hurl/coverage/badges/flat.svg)](https://Orange-OpenSource.github.io/hurl/coverage)
[![Crates.io](https://img.shields.io/crates/v/hurl.svg)](https://crates.io/crates/hurl)
[![documentation](https://img.shields.io/badge/-documentation-ff0288)](https://hurl.dev)
# What's Hurl?
Hurl is a command line tool that runs <b>HTTP requests</b> defined in a simple <b>plain text format</b>.
It can chain requests, capture values and evaluate queries on headers and body response. Hurl is very
versatile: it can be used for both <b>fetching data</b> and <b>testing HTTP</b> sessions.
Hurl makes it easy to work with <b>HTML</b> content, <b>REST / SOAP / GraphQL</b> APIs, or any other <b>XML / JSON</b> based APIs.
```hurl
# Get home:
GET https://example.org
HTTP 200
[Captures]
csrf_token: xpath "string(//meta[@name='_csrf_token']/@content)"
# Do login!
POST https://example.org/login?user=toto&password=1234
X-CSRF-TOKEN: {{csrf_token}}
HTTP 302
```
Chaining multiple requests is easy:
```hurl
GET https://example.org/api/health
GET https://example.org/api/step1
GET https://example.org/api/step2
GET https://example.org/api/step3
```
# Also an HTTP Test Tool
Hurl can run HTTP requests but can also be used to <b>test HTTP responses</b>.
Different types of queries and predicates are supported, from [XPath] and [JSONPath] on body response,
to assert on status code and response headers.
<a href="https://hurl.dev/player.html?id=hurl&speed=3"><img src="/docs/assets/img/poster-hurl.png" width="100%" alt="Hurl Demo"/></a>
It is well adapted for <b>REST / JSON APIs</b>
```hurl
POST https://example.org/api/tests
{
"id": "4568",
"evaluate": true
}
HTTP 200
[Asserts]
header "X-Frame-Options" == "SAMEORIGIN"
jsonpath "$.status" == "RUNNING" # Check the status code
jsonpath "$.tests" count == 25 # Check the number of items
jsonpath "$.id" matches /\d{4}/ # Check the format of the id
```
<b>HTML content</b>
```hurl
GET https://example.org
HTTP 200
[Asserts]
xpath "normalize-space(//head/title)" == "Hello world!"
```
<b>GraphQL</b>
~~~hurl
POST https://example.org/graphql
```graphql
{
human(id: "1000") {
name
height(unit: FOOT)
}
}
```
HTTP 200
~~~
and even <b>SOAP APIs</b>
```hurl
POST https://example.org/InStock
Content-Type: application/soap+xml; charset=utf-8
SOAPAction: "http://www.w3.org/2003/05/soap-envelope"
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:m="https://example.org">
<soap:Header></soap:Header>
<soap:Body>
<m:GetStockPrice>
<m:StockName>GOOG</m:StockName>
</m:GetStockPrice>
</soap:Body>
</soap:Envelope>
HTTP 200
```
Hurl can also be used to test the <b>performance</b> of HTTP endpoints
```hurl
GET https://example.org/api/v1/pets
HTTP 200
[Asserts]
duration < 1000 # Duration in ms
```
And check response bytes
```hurl
GET https://example.org/data.tar.gz
HTTP 200
[Asserts]
sha256 == hex,039058c6f2c0cb492c533b0a4d14ef77cc0f78abccced5287d84a1a2011cfb81;
```
Finally, Hurl is easy to <b>integrate in CI/CD</b>, with text, JUnit, TAP and HTML reports
<picture>
<source media="(prefers-color-scheme: light)" srcset="/docs/assets/img/home-waterfall-light.png">
<source media="(prefers-color-scheme: dark)" srcset="/docs/assets/img/home-waterfall-dark.png">
<img src="/docs/assets/img/home-waterfall-light.png" width="480" alt="HTML report"/>
</picture>
# Why Hurl?
<ul class="showcase-container">
<li><b>Text Format:</b> for both devops and developers</li>
<li><b>Fast CLI:</b> a command line for local dev and continuous integration</li>
<li><b>Single Binary:</b> easy to install, with no runtime required</li>
</ul>
# Powered by curl
Hurl is a lightweight binary written in [Rust]. Under the hood, Hurl HTTP engine is
powered by [libcurl], one of the most powerful and reliable file transfer libraries.
With its text file format, Hurl adds syntactic sugar to run and test HTTP requests,
but it's still the [curl] that we love: __fast__, __efficient__ and __HTTP/3 ready__.
# Feedbacks
To support its development, [star Hurl on GitHub]!
[Feedback, suggestion, bugs or improvements] are welcome.
```hurl
POST https://hurl.dev/api/feedback
{
"name": "John Doe",
"feedback": "Hurl is awesome!"
}
HTTP 200
```
# Resources
[License]
[Blog]
[Tutorial]
[Documentation]
[GitHub]
Table of Contents
=================
* [Samples](#samples)
* [Getting Data](#getting-data)
* [HTTP Headers](#http-headers)
* [Query Params](#query-params)
* [Basic Authentication](#basic-authentication)
* [Passing Data between Requests ](#passing-data-between-requests)
* [Sending Data](#sending-data)
* [Sending HTML Form Data](#sending-html-form-data)
* [Sending Multipart Form Data](#sending-multipart-form-data)
* [Posting a JSON Body](#posting-a-json-body)
* [Templating a JSON Body](#templating-a-json-body)
* [Templating a XML Body](#templating-a-xml-body)
* [Using GraphQL Query](#using-graphql-query)
* [Testing Response](#testing-response)
* [Testing Status Code](#testing-status-code)
* [Testing Response Headers](#testing-response-headers)
* [Testing REST APIs](#testing-rest-apis)
* [Testing HTML Response](#testing-html-response)
* [Testing Set-Cookie Attributes](#testing-set-cookie-attributes)
* [Testing Bytes Content](#testing-bytes-content)
* [SSL Certificate](#ssl-certificate)
* [Checking Full Body](#checking-full-body)
* [Reports](#reports)
* [HTML Report](#html-report)
* [JUnit Report](#junit-report)
* [TAP Report](#tap-report)
* [JSON Output](#json-output)
* [Others](#others)
* [HTTP Version](#http-version)
* [Polling and Retry](#polling-and-retry)
* [Delaying Requests](#delaying-requests)
* [Skipping Requests](#skipping-requests)
* [Testing Endpoint Performance](#testing-endpoint-performance)
* [Using SOAP APIs](#using-soap-apis)
* [Capturing and Using a CSRF Token](#capturing-and-using-a-csrf-token)
* [Checking Byte Order Mark (BOM) in Response Body](#checking-byte-order-mark-bom-in-response-body)
* [AWS Signature Version 4 Requests](#aws-signature-version-4-requests)
* [Manual](#manual)
* [Name](#name)
* [Synopsis](#synopsis)
* [Description](#description)
* [Hurl File Format](#hurl-file-format)
* [Capturing values](#capturing-values)
* [Asserts](#asserts)
* [Options](#options)
* [Environment](#environment)
* [Exit Codes](#exit-codes)
* [WWW](#www)
* [See Also](#see-also)
* [Installation](#installation)
* [Binaries Installation](#binaries-installation)
* [Linux](#linux)
* [Debian / Ubuntu](#debian--ubuntu)
* [Alpine](#alpine)
* [Arch Linux / Manjaro](#arch-linux--manjaro)
* [NixOS / Nix](#nixos--nix)
* [macOS](#macos)
* [Homebrew](#homebrew)
* [MacPorts](#macports)
* [FreeBSD](#freebsd)
* [Windows](#windows)
* [Zip File](#zip-file)
* [Installer](#installer)
* [Chocolatey](#chocolatey)
* [Scoop](#scoop)
* [Windows Package Manager](#windows-package-manager)
* [Cargo](#cargo)
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
一个命令行工具,用于运行简单纯文本格式定义的HTTP请求。它能够轻松处理HTML内容、REST / SOAP / GraphQL api或任何其他基于XML / JSON的api。Hurl的简单易用性使得处理HTTP请求变得更加便捷高效。
资源推荐
资源详情
资源评论
收起资源包目录
命令行HTTP请求工具 (1974个子文件)
hurl.1 15KB
hurl.1 15KB
hurlfmt.1 2KB
hurlfmt.1 2KB
_hurl 5KB
_hurlfmt 1KB
logo-full.acorn 96KB
logo-mini.acorn 88KB
logo-icon.acorn 88KB
hurl-x.y.z-x86_64-unknown-linux-gnu.tar.gz.anatomy 1KB
hurl-x.y.z-aarch64-apple-darwin.tar.gz.anatomy 1KB
hurl-x.y.z-x86_64-apple-darwin.tar.gz.anatomy 1KB
hurl-x.y.z-x86_64-pc-windows-msvc-installer.exe.anatomy 1KB
hurl_x.y.z_amd64.deb.anatomy 832B
hurl-x.y.z-x86_64-pc-windows-msvc.zip.anatomy 743B
movies-box-light.avif 69KB
movies-box-dark.avif 68KB
gitlab-new-repository-light.avif 38KB
gitlab-new-repository-dark.avif 36KB
developer-tools.avif 30KB
gitlab-pipeline-dark.avif 28KB
github-new-repository-light.avif 24KB
github-new-repository-dark.avif 22KB
github-action-dark.avif 19KB
github-action-light.avif 19KB
gitlab-pipeline-light.avif 19KB
home-waterfall-light.avif 8KB
home-waterfall-dark.avif 7KB
hurl.bash 1002B
hurlfmt.bash 402B
assert_body.bin 18B
readonly.bin 12B
data.bin 12B
data.bin 12B
data.bin 12B
bytes.bin 3B
logo.bmp 630KB
cat.jpg.br 25KB
libxml.c 192B
hurl.cast 28KB
CODEOWNERS 121B
cookie_file.cookies 41B
run.css 1KB
source.css 1KB
hurl.css 1KB
nav.css 1KB
timeline.css 712B
report.css 638B
style.css 621B
waterfall.css 459B
calls.css 184B
content_type.curl 2KB
compressed_option.curl 1KB
compressed.curl 1KB
post_json.curl 1KB
graphql.curl 984B
multilines.curl 935B
method.curl 924B
multipart_form_data.curl 818B
multipart_form_data.windows.curl 818B
cookies.curl 748B
follow_redirect_option.curl 704B
variables.curl 589B
very_verbose.curl 577B
very_verbose.windows.curl 577B
basic_authentication_per_request.curl 515B
aws_sigv4_option.curl 476B
connect_to.curl 449B
json_output.curl 443B
querystring_params.curl 404B
resolve_option.curl 401B
resolve.curl 401B
http_version_option.curl 396B
connect_to_option.curl 372B
form_params.curl 352B
fileroot.curl 273B
post_multilines.curl 257B
follow_redirect.curl 252B
output_option.curl 252B
redirect.curl 250B
assert_json.curl 222B
post_file.curl 210B
post_file.windows.curl 210B
assert_xpath.curl 201B
assert_status_code.curl 192B
cookie_storage.curl 184B
assert_body.curl 174B
options.curl 171B
patch.curl 171B
predicates_string.curl 155B
captures.curl 150B
post_base64.curl 150B
client_authentication_password.curl 145B
bom.windows.curl 145B
bom.curl 144B
hello.curl 139B
post_large.windows.curl 131B
client_authentication.curl 129B
post_large.curl 128B
request_content_length.curl 121B
共 1974 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
UnknownToKnown
- 粉丝: 1w+
- 资源: 593
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功