Skip to content

Commit

Permalink
feat: Add request templates for dev and prod use (#29)
Browse files Browse the repository at this point in the history
* feat: Add request templates for dev and prod use

* docs: Update README with request template info
  • Loading branch information
essteer authored Nov 16, 2024
1 parent 4dccb54 commit 65dc3b3
Show file tree
Hide file tree
Showing 19 changed files with 57 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ $ curl -X GET 'https://masquer.fly.dev/api/v1/masq?ua=true&rf=true' -H 'accept:

The optional `count` parameter specifies the number of objects to return in the response. The default value is `1`.

Refer to the [API docs](`https://masquer.fly.dev/docs`) for other examples, or see [more details below](#examples) in the package documentation.
Refer to the [API docs](`https://masquer.fly.dev/docs`) for other examples, or see [more details below](#examples) in the package documentation. The `tests/requests/` directory also contains HTTP request examples for use in development and production.

<h3 align="center">
<a href="#title"><img src="https://img.shields.io/badge/▲%20Top%20▲-0466c8.svg?style=flat"></a>
Expand Down
3 changes: 3 additions & 0 deletions tests/requests/dev/default.posting.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: default
description: Default GET request with no parameters, returns a random useragent.
url: http://127.0.0.1:8000/api/v1/masq
3 changes: 3 additions & 0 deletions tests/requests/dev/hd.posting.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: hd
description: Returns header data with random useragent and fixed referer.
url: http://127.0.0.1:8000/api/v1/masq?ua=false&hd=true
3 changes: 3 additions & 0 deletions tests/requests/dev/rf-hd.posting.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: rf-hd
description: Returns header data with fixed useragent and random referer.
url: http://127.0.0.1:8000/api/v1/masq?ua=false&rf=true&hd=true
3 changes: 3 additions & 0 deletions tests/requests/dev/rf.posting.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: rf
description: Returns a random referer.
url: http://127.0.0.1:8000/api/v1/masq?ua=false&rf=true
3 changes: 3 additions & 0 deletions tests/requests/dev/ua-hd.posting.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: ua-hd
description: Returns header data with random useragent and fixed referer.
url: http://127.0.0.1:8000/api/v1/masq?ua=true&hd=true
4 changes: 4 additions & 0 deletions tests/requests/dev/ua-rf-hd-count.posting.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name: ua-rf-hd-count
description: Returns multiple sets of header data with random useragent and random
referer, as specified by the count param.
url: http://127.0.0.1:8000/api/v1/masq?ua=true&rf=true&hd=true&count=3
3 changes: 3 additions & 0 deletions tests/requests/dev/ua-rf-hd.posting.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: ua-rf-hd
description: Returns header data with random useragent and random referer.
url: http://127.0.0.1:8000/api/v1/masq?ua=true&rf=true&hd=true
3 changes: 3 additions & 0 deletions tests/requests/dev/ua-rf.posting.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: ua-rf
description: Returns random useragent and random referer.
url: http://127.0.0.1:8000/api/v1/masq?ua=true&rf=true
3 changes: 3 additions & 0 deletions tests/requests/dev/ua.posting.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: ua
description: Returns a random useragent, equivalent to the default with no params.
url: http://127.0.0.1:8000/api/v1/masq?ua=true
3 changes: 3 additions & 0 deletions tests/requests/prod/default.posting.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: default
description: Default GET request with no parameters, returns a random useragent.
url: https://masquer.fly.dev/api/v1/masq
3 changes: 3 additions & 0 deletions tests/requests/prod/hd.posting.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: hd
description: Returns header data with random useragent and fixed referer.
url: https://masquer.fly.dev/api/v1/masq?ua=false&hd=true
3 changes: 3 additions & 0 deletions tests/requests/prod/rf-hd.posting.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: rf-hd
description: Returns header data with fixed useragent and random referer.
url: https://masquer.fly.dev/api/v1/masq?ua=false&rf=true&hd=true
3 changes: 3 additions & 0 deletions tests/requests/prod/rf.posting.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: rf
description: Returns a random referer.
url: https://masquer.fly.dev/api/v1/masq?ua=false&rf=true
3 changes: 3 additions & 0 deletions tests/requests/prod/ua-hd.posting.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: ua-hd
description: Returns header data with random useragent and fixed referer.
url: https://masquer.fly.dev/api/v1/masq?ua=true&hd=true
4 changes: 4 additions & 0 deletions tests/requests/prod/ua-rf-hd-count.posting.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name: ua-rf-hd-count
description: Returns multiple sets of header data with random useragent and random
referer, as specified by the count param.
url: https://masquer.fly.dev/api/v1/masq?ua=true&rf=true&hd=true&count=3
3 changes: 3 additions & 0 deletions tests/requests/prod/ua-rf-hd.posting.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: ua-rf-hd
description: Returns header data with random useragent and random referer.
url: https://masquer.fly.dev/api/v1/masq?ua=true&rf=true&hd=true
3 changes: 3 additions & 0 deletions tests/requests/prod/ua-rf.posting.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: ua-rf
description: Returns random useragent and random referer.
url: https://masquer.fly.dev/api/v1/masq?ua=true&rf=true
3 changes: 3 additions & 0 deletions tests/requests/prod/ua.posting.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: ua
description: Returns a random useragent, equivalent to the default with no params.
url: https://masquer.fly.dev/api/v1/masq?ua=true

0 comments on commit 65dc3b3

Please sign in to comment.