Initial impl

This commit is contained in:
Torbjörn Molin committed 2026-10-19 09:31:57 +02:00
commit 4b729c5d32
133 files changed
+20475

No files matched your search

@@ -0,0 +1,12 @@
---
source: crates/core/tests/import.rs
expression: http
---
GET https://api.github.com/repos/rust-lang/rust/issues?state=open&per_page=5
accept: application/vnd.github+json
accept-language: en-US,en;q=0.9,sv;q=0.8
cache-control: no-cache
origin: https://github.com
priority: u=1, i
sec-fetch-mode: cors
user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36
@@ -0,0 +1,10 @@
---
source: crates/core/tests/import.rs
expression: http
---
POST https://example.com/api/graphql
accept: */*
content-type: application/json
Cookie: session=abc123; theme=dark
{"query":"query { me { name } }","note":"it's here\nnext line"}
@@ -0,0 +1,6 @@
---
source: crates/core/tests/import.rs
expression: http
---
GET https://example.com/search?q=a%20b
accept: text/html
@@ -0,0 +1,10 @@
---
source: crates/core/tests/import.rs
expression: http
---
POST https://example.com/api/items?page=2&size=10
accept: application/json
content-type: application/json
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36
{"name":"Widget 50%","price":9.5}
@@ -0,0 +1,10 @@
---
source: crates/core/tests/import.rs
expression: http
---
POST https://httpbin.org/post
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:140.0) Gecko/20100101 Firefox/140.0
Content-Type: application/x-www-form-urlencoded
Origin: https://httpbin.org
a=1&b=two%20words
@@ -0,0 +1,11 @@
---
source: crates/core/tests/import.rs
expression: http
---
GET https://developer.mozilla.org/api/v1/whoami
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:140.0) Gecko/20100101 Firefox/140.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Referer: https://developer.mozilla.org/en-US/
Connection: keep-alive
Sec-Fetch-Mode: cors
@@ -0,0 +1,8 @@
---
source: crates/core/tests/import.rs
expression: http
---
PUT https://httpbin.org/anything
Content-Type: application/json
{"ok":true}
@@ -0,0 +1,8 @@
---
source: crates/core/tests/import.rs
expression: http
---
# @timeout 10
# @insecure
DELETE https://localhost:8443/api/users/42
Authorization: Basic admin s3cret
@@ -0,0 +1,8 @@
---
source: crates/core/tests/import.rs
expression: http
---
PATCH https://api.example.com/users/1
Content-Type: application/json
< payloads/patch.json
@@ -0,0 +1,6 @@
---
source: crates/core/tests/import.rs
expression: http
---
GET https://api.example.com/search?q=rust%20lang&page=2
User-Agent: reqlite-test/1.0
@@ -0,0 +1,5 @@
---
source: crates/core/tests/import.rs
expression: http
---
HEAD https://example.com/ HTTP/2
@@ -0,0 +1,9 @@
---
source: crates/core/tests/import.rs
expression: http
---
POST https://api.example.com/users
Content-Type: application/json
Accept: application/json
{"name":"Ada"}
@@ -0,0 +1,21 @@
---
source: crates/core/tests/import.rs
expression: http
---
POST https://upload.example.com/v1/photos
Content-Type: multipart/form-data; boundary=WebAppBoundary
--WebAppBoundary
Content-Disposition: form-data; name="title"
Holiday photo
--WebAppBoundary
Content-Disposition: form-data; name="file"; filename="beach.jpg"
Content-Type: image/jpeg
< ./photos/beach.jpg
--WebAppBoundary
Content-Disposition: form-data; name="meta"
< ./meta.json
--WebAppBoundary--
@@ -0,0 +1,94 @@
---
source: crates/core/tests/import.rs
expression: out
---
==> products/admin/admin.http
### Delete product
DELETE {{baseUrl}}/products/1
Authorization: Basic admin {{adminPass}}
### Search (GraphQL)
POST {{baseUrl}}/graphql
Authorization: Basic admin {{adminPass}}
Content-Type: application/json
{
"query": "query { products { id name } }",
"variables": {
"first": 5
}
}
==> products/products.http
### List products
GET {{baseUrl}}/products?limit={{pageSize}}&sort=name
Accept: application/json
# X-Debug: 1
Authorization: Bearer {{token}}
### Create product
POST {{baseUrl}}/products
Authorization: Bearer {{token}}
Content-Type: application/json
{
"name": "Widget",
"price": 9.5
}
### Upload image
POST {{baseUrl}}/products/1/image
Authorization: Bearer {{token}}
Content-Type: multipart/form-data; boundary=WebAppBoundary
--WebAppBoundary
Content-Disposition: form-data; name="caption"
Front view
--WebAppBoundary
Content-Disposition: form-data; name="image"; filename="widget.png"
< /home/me/widget.png
--WebAppBoundary--
==> auth/auth.http
### Token
POST https://auth.example.com/oauth/token
Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials&client_id={{clientId}}
### API key ping
GET {{baseUrl}}/ping
X-Api-Key: {{apiKey}}
### Digest thing
GET {{baseUrl}}/digest
==> shop-api.http
### Health
GET {{baseUrl}}/health
==> http-client.env.json
{
"$shared": {
"baseUrl": "https://shop.example.com/api",
"pageSize": "20"
},
"Shop dev": {
"baseUrl": "http://localhost:8080/api"
}
}
==> http-client.private.env.json
{
"Shop dev": {
"token": "dev-token-123",
"adminPass": "hunter2"
}
}
==> warnings
Skipped scripts on request "Shop API/Products/List products"
Skipped scripts on request "Shop API/Auth/Token"
Unsupported auth type "digest" on "Shop API/Auth/Digest thing"; add the header by hand