dothttp-req 0.0.44a34__tar.gz → 0.0.44a36__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/PKG-INFO +99 -12
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/README.md +96 -9
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dothttp/__main__.py +15 -1
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dothttp/parse/__init__.py +3 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dothttp/parse/request_base.py +8 -1
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/pyproject.toml +5 -5
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/LICENSE.txt +0 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dotextensions/__init__.py +0 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dotextensions/server/__init__.py +0 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dotextensions/server/__main__.py +0 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dotextensions/server/agent.py +0 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dotextensions/server/handlers/__init__.py +0 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dotextensions/server/handlers/basic_handlers.py +0 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dotextensions/server/handlers/fs_handlers.py +0 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dotextensions/server/handlers/gohandler.py +0 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dotextensions/server/handlers/har2httphandler.py +0 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dotextensions/server/handlers/http2har.py +0 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dotextensions/server/handlers/http2postman.py +0 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dotextensions/server/handlers/postman2http.py +0 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dotextensions/server/models/__init__.py +0 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dotextensions/server/models/har.py +0 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dotextensions/server/postman/__init__.py +0 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dotextensions/server/postman2_1/__init__.py +0 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dotextensions/server/server.py +0 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dotextensions/server/utils.py +0 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dotextensions/version/__init__.py +0 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dotextensions/version/__main__.py +0 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dothttp/__init__.py +0 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dothttp/__version__.py +0 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dothttp/auth/__init__.py +0 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dothttp/auth/azure_auth.py +0 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dothttp/exceptions.py +0 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dothttp/http.tx +0 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dothttp/models/__init__.py +0 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dothttp/models/computed.py +0 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dothttp/models/parse_models.py +0 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dothttp/parse/dsl_jsonparser.py +0 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dothttp/parse/expression.py +0 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dothttp/postScript.js +0 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dothttp/property_schema.py +0 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dothttp/script/__init__.py +0 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dothttp/script/js3py.py +0 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dothttp/utils/__init__.py +0 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dothttp/utils/common.py +0 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dothttp/utils/constants.py +0 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dothttp/utils/curl_utils.py +0 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dothttp/utils/json_utils.py +0 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dothttp/utils/log_utils.py +0 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dothttp/utils/property_util.py +0 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dothttp_test/__init__.py +0 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dothttp_test/__main__.py +0 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dothttp_test/conftest.py +0 -0
- {dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dothttp_test/dothttp_test.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dothttp-req
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.44a36
|
|
4
4
|
Summary: Dothttp is Simple http client for testing and development
|
|
5
5
|
License: MIT
|
|
6
6
|
License-File: LICENSE.txt
|
|
@@ -15,7 +15,7 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.12
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.13
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.14
|
|
18
|
-
Requires-Dist: cryptography (==
|
|
18
|
+
Requires-Dist: cryptography (==50.0.0)
|
|
19
19
|
Requires-Dist: faker (==40.21.0)
|
|
20
20
|
Requires-Dist: idna (==3.18)
|
|
21
21
|
Requires-Dist: jsonschema (==4.26.0)
|
|
@@ -28,7 +28,7 @@ Requires-Dist: requests-aws4auth (==1.3.2)
|
|
|
28
28
|
Requires-Dist: requests-hawk (==1.2.1)
|
|
29
29
|
Requires-Dist: requests-ntlm (==1.3.0)
|
|
30
30
|
Requires-Dist: requests-pkcs12 (==1.27)
|
|
31
|
-
Requires-Dist: restrictedpython (==8.
|
|
31
|
+
Requires-Dist: restrictedpython (==8.4)
|
|
32
32
|
Requires-Dist: textx (==4.2.3)
|
|
33
33
|
Requires-Dist: toml (==0.10.2)
|
|
34
34
|
Requires-Dist: urllib3 (==2.7.0)
|
|
@@ -355,13 +355,15 @@ via [dothttp-code](https://marketplace.visualstudio.com/items?itemName=ShivaPras
|
|
|
355
355
|
### Command line options
|
|
356
356
|
|
|
357
357
|
```
|
|
358
|
-
usage: dothttp [-h] [--curl] [--property-file PROPERTY_FILE] [--no-cookie]
|
|
359
|
-
[--
|
|
360
|
-
|
|
358
|
+
usage: dothttp [-h] [--curl] [--property-file PROPERTY_FILE] [--no-cookie]
|
|
359
|
+
[--env ENV [ENV ...]] [--debug] [--info] [--format]
|
|
360
|
+
[--experimental] [--stdout]
|
|
361
|
+
[--property PROPERTY [PROPERTY ...]] [--target TARGET]
|
|
362
|
+
[file]
|
|
361
363
|
|
|
362
364
|
http requests for humans
|
|
363
365
|
|
|
364
|
-
|
|
366
|
+
options:
|
|
365
367
|
-h, --help show this help message and exit
|
|
366
368
|
|
|
367
369
|
general:
|
|
@@ -369,23 +371,108 @@ general:
|
|
|
369
371
|
--no-cookie, -nc cookie storage is disabled
|
|
370
372
|
--debug, -d debug will enable logs and exceptions
|
|
371
373
|
--info, -i more information
|
|
372
|
-
file http file
|
|
374
|
+
file http file. use `-` or omit to read http content from
|
|
375
|
+
stdin
|
|
376
|
+
--target, -t TARGET targets a particular http definition
|
|
373
377
|
|
|
374
378
|
property:
|
|
375
|
-
--property-file
|
|
379
|
+
--property-file, -p PROPERTY_FILE
|
|
376
380
|
property file
|
|
377
|
-
--env
|
|
378
|
-
environment to select in property file. properties
|
|
381
|
+
--env, -e ENV [ENV ...]
|
|
382
|
+
environment to select in property file. properties
|
|
383
|
+
will be enabled on FIFO
|
|
384
|
+
--experimental, --b enable experimental
|
|
379
385
|
--property PROPERTY [PROPERTY ...]
|
|
380
386
|
list of property's
|
|
381
387
|
|
|
382
388
|
format:
|
|
383
|
-
--format, -fmt
|
|
389
|
+
--format, -fmt format http file
|
|
384
390
|
--stdout print to commandline
|
|
385
391
|
```
|
|
386
392
|
|
|
387
393
|
checkout [examples]('./examples/dothttpazure.http')
|
|
388
394
|
|
|
395
|
+
-----------
|
|
396
|
+
|
|
397
|
+
## Using dothttp with AI agents / coding assistants
|
|
398
|
+
|
|
399
|
+
**dothttp** is stdin/stdout friendly, so an AI agent (Claude Code, Cursor, a
|
|
400
|
+
custom LLM tool, a CI script, etc.) can fire a request without ever writing a
|
|
401
|
+
`.http` file to disk or leaving temp files behind.
|
|
402
|
+
|
|
403
|
+
Pipe the `.http` content on stdin using `-` as the file argument (or just
|
|
404
|
+
omit the file argument altogether):
|
|
405
|
+
|
|
406
|
+
```shell
|
|
407
|
+
echo 'GET "https://httpbin.org/get"' | dothttp -
|
|
408
|
+
# or, equivalently
|
|
409
|
+
echo 'GET "https://httpbin.org/get"' | dothttp
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
The response body is written to stdout, exactly like the file-based flow —
|
|
413
|
+
no extra banners or separators clutter the output unless a test script
|
|
414
|
+
(see [Templating](#templating)) actually produces something to report.
|
|
415
|
+
|
|
416
|
+
This composes with the regular flags, so an agent can still target a
|
|
417
|
+
specific request, substitute properties, or ask for a curl script instead
|
|
418
|
+
of executing the request:
|
|
419
|
+
|
|
420
|
+
```shell
|
|
421
|
+
# multiple requests in one payload, run the 2nd one
|
|
422
|
+
# a heredoc is the easiest way to hand over multi-line content
|
|
423
|
+
dothttp - --target 2 <<EOF
|
|
424
|
+
GET "https://httpbin.org/get"
|
|
425
|
+
|
|
426
|
+
POST "https://httpbin.org/post"
|
|
427
|
+
EOF
|
|
428
|
+
|
|
429
|
+
# substitute a property from the command line
|
|
430
|
+
echo 'GET "https://httpbin.org/get?key={{myprop}}"' \
|
|
431
|
+
| dothttp - --property myprop=myvalue
|
|
432
|
+
|
|
433
|
+
# get a shareable curl command instead of executing the request
|
|
434
|
+
echo 'GET "https://httpbin.org/get"' | dothttp - --curl
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
Property-file auto-discovery (`.dothttp.json`/`.yaml`/`.yml`/`.toml` in the
|
|
438
|
+
current directory) still works in stdin mode, since it's resolved relative
|
|
439
|
+
to the working directory the command is run from — handy for agents that
|
|
440
|
+
run from within a project checkout.
|
|
441
|
+
|
|
442
|
+
An explicit `>> "path/to/file"` output directive inside the piped content
|
|
443
|
+
still writes to that file instead of stdout, same as file-based input.
|
|
444
|
+
|
|
445
|
+
#### Reusing existing request definitions (`import` + `@name(...) : base`)
|
|
446
|
+
|
|
447
|
+
An agent working inside a project usually doesn't need to reinvent auth,
|
|
448
|
+
headers, or retry/timeout settings for every new request — a project's
|
|
449
|
+
existing `.http` files already define them. **dothttp** supports `import`
|
|
450
|
+
and named request inheritance (`@name("child") : "base"`), so an agent's
|
|
451
|
+
stdin snippet can just import the file with the shared setup and extend it,
|
|
452
|
+
inheriting everything from the base and overriding only what's different
|
|
453
|
+
(the path, method, payload, etc).
|
|
454
|
+
|
|
455
|
+
For example, [`examples/inheritance_example.http`](./examples/inheritance_example.http)
|
|
456
|
+
already defines an `"api base"` request with a host, `Authorization` header,
|
|
457
|
+
`timeout`, and `retry` configured. An agent can reuse all of it with a
|
|
458
|
+
two-line snippet:
|
|
459
|
+
|
|
460
|
+
```shell
|
|
461
|
+
dothttp - --target "get repo" <<'EOF'
|
|
462
|
+
import "examples/inheritance_example.http";
|
|
463
|
+
|
|
464
|
+
@name("get repo") : "api base"
|
|
465
|
+
GET /repos/cedric05/dothttp
|
|
466
|
+
EOF
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
This resolves to `GET https://api.github.com/repos/cedric05/dothttp` with
|
|
470
|
+
the `Authorization`, `timeout`, and `retry` settings from `"api base"`
|
|
471
|
+
applied automatically — the agent never had to know or copy those details.
|
|
472
|
+
`import` paths (like `--property-file` auto-discovery above) are resolved
|
|
473
|
+
relative to the working directory the command is run from, so this works
|
|
474
|
+
best when the agent runs from the project root.
|
|
475
|
+
|
|
389
476
|
-----------
|
|
390
477
|
### Vscode alternatives
|
|
391
478
|
|
|
@@ -317,13 +317,15 @@ via [dothttp-code](https://marketplace.visualstudio.com/items?itemName=ShivaPras
|
|
|
317
317
|
### Command line options
|
|
318
318
|
|
|
319
319
|
```
|
|
320
|
-
usage: dothttp [-h] [--curl] [--property-file PROPERTY_FILE] [--no-cookie]
|
|
321
|
-
[--
|
|
322
|
-
|
|
320
|
+
usage: dothttp [-h] [--curl] [--property-file PROPERTY_FILE] [--no-cookie]
|
|
321
|
+
[--env ENV [ENV ...]] [--debug] [--info] [--format]
|
|
322
|
+
[--experimental] [--stdout]
|
|
323
|
+
[--property PROPERTY [PROPERTY ...]] [--target TARGET]
|
|
324
|
+
[file]
|
|
323
325
|
|
|
324
326
|
http requests for humans
|
|
325
327
|
|
|
326
|
-
|
|
328
|
+
options:
|
|
327
329
|
-h, --help show this help message and exit
|
|
328
330
|
|
|
329
331
|
general:
|
|
@@ -331,23 +333,108 @@ general:
|
|
|
331
333
|
--no-cookie, -nc cookie storage is disabled
|
|
332
334
|
--debug, -d debug will enable logs and exceptions
|
|
333
335
|
--info, -i more information
|
|
334
|
-
file http file
|
|
336
|
+
file http file. use `-` or omit to read http content from
|
|
337
|
+
stdin
|
|
338
|
+
--target, -t TARGET targets a particular http definition
|
|
335
339
|
|
|
336
340
|
property:
|
|
337
|
-
--property-file
|
|
341
|
+
--property-file, -p PROPERTY_FILE
|
|
338
342
|
property file
|
|
339
|
-
--env
|
|
340
|
-
environment to select in property file. properties
|
|
343
|
+
--env, -e ENV [ENV ...]
|
|
344
|
+
environment to select in property file. properties
|
|
345
|
+
will be enabled on FIFO
|
|
346
|
+
--experimental, --b enable experimental
|
|
341
347
|
--property PROPERTY [PROPERTY ...]
|
|
342
348
|
list of property's
|
|
343
349
|
|
|
344
350
|
format:
|
|
345
|
-
--format, -fmt
|
|
351
|
+
--format, -fmt format http file
|
|
346
352
|
--stdout print to commandline
|
|
347
353
|
```
|
|
348
354
|
|
|
349
355
|
checkout [examples]('./examples/dothttpazure.http')
|
|
350
356
|
|
|
357
|
+
-----------
|
|
358
|
+
|
|
359
|
+
## Using dothttp with AI agents / coding assistants
|
|
360
|
+
|
|
361
|
+
**dothttp** is stdin/stdout friendly, so an AI agent (Claude Code, Cursor, a
|
|
362
|
+
custom LLM tool, a CI script, etc.) can fire a request without ever writing a
|
|
363
|
+
`.http` file to disk or leaving temp files behind.
|
|
364
|
+
|
|
365
|
+
Pipe the `.http` content on stdin using `-` as the file argument (or just
|
|
366
|
+
omit the file argument altogether):
|
|
367
|
+
|
|
368
|
+
```shell
|
|
369
|
+
echo 'GET "https://httpbin.org/get"' | dothttp -
|
|
370
|
+
# or, equivalently
|
|
371
|
+
echo 'GET "https://httpbin.org/get"' | dothttp
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
The response body is written to stdout, exactly like the file-based flow —
|
|
375
|
+
no extra banners or separators clutter the output unless a test script
|
|
376
|
+
(see [Templating](#templating)) actually produces something to report.
|
|
377
|
+
|
|
378
|
+
This composes with the regular flags, so an agent can still target a
|
|
379
|
+
specific request, substitute properties, or ask for a curl script instead
|
|
380
|
+
of executing the request:
|
|
381
|
+
|
|
382
|
+
```shell
|
|
383
|
+
# multiple requests in one payload, run the 2nd one
|
|
384
|
+
# a heredoc is the easiest way to hand over multi-line content
|
|
385
|
+
dothttp - --target 2 <<EOF
|
|
386
|
+
GET "https://httpbin.org/get"
|
|
387
|
+
|
|
388
|
+
POST "https://httpbin.org/post"
|
|
389
|
+
EOF
|
|
390
|
+
|
|
391
|
+
# substitute a property from the command line
|
|
392
|
+
echo 'GET "https://httpbin.org/get?key={{myprop}}"' \
|
|
393
|
+
| dothttp - --property myprop=myvalue
|
|
394
|
+
|
|
395
|
+
# get a shareable curl command instead of executing the request
|
|
396
|
+
echo 'GET "https://httpbin.org/get"' | dothttp - --curl
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
Property-file auto-discovery (`.dothttp.json`/`.yaml`/`.yml`/`.toml` in the
|
|
400
|
+
current directory) still works in stdin mode, since it's resolved relative
|
|
401
|
+
to the working directory the command is run from — handy for agents that
|
|
402
|
+
run from within a project checkout.
|
|
403
|
+
|
|
404
|
+
An explicit `>> "path/to/file"` output directive inside the piped content
|
|
405
|
+
still writes to that file instead of stdout, same as file-based input.
|
|
406
|
+
|
|
407
|
+
#### Reusing existing request definitions (`import` + `@name(...) : base`)
|
|
408
|
+
|
|
409
|
+
An agent working inside a project usually doesn't need to reinvent auth,
|
|
410
|
+
headers, or retry/timeout settings for every new request — a project's
|
|
411
|
+
existing `.http` files already define them. **dothttp** supports `import`
|
|
412
|
+
and named request inheritance (`@name("child") : "base"`), so an agent's
|
|
413
|
+
stdin snippet can just import the file with the shared setup and extend it,
|
|
414
|
+
inheriting everything from the base and overriding only what's different
|
|
415
|
+
(the path, method, payload, etc).
|
|
416
|
+
|
|
417
|
+
For example, [`examples/inheritance_example.http`](./examples/inheritance_example.http)
|
|
418
|
+
already defines an `"api base"` request with a host, `Authorization` header,
|
|
419
|
+
`timeout`, and `retry` configured. An agent can reuse all of it with a
|
|
420
|
+
two-line snippet:
|
|
421
|
+
|
|
422
|
+
```shell
|
|
423
|
+
dothttp - --target "get repo" <<'EOF'
|
|
424
|
+
import "examples/inheritance_example.http";
|
|
425
|
+
|
|
426
|
+
@name("get repo") : "api base"
|
|
427
|
+
GET /repos/cedric05/dothttp
|
|
428
|
+
EOF
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
This resolves to `GET https://api.github.com/repos/cedric05/dothttp` with
|
|
432
|
+
the `Authorization`, `timeout`, and `retry` settings from `"api base"`
|
|
433
|
+
applied automatically — the agent never had to know or copy those details.
|
|
434
|
+
`import` paths (like `--property-file` auto-discovery above) are resolved
|
|
435
|
+
relative to the working directory the command is run from, so this works
|
|
436
|
+
best when the agent runs from the project root.
|
|
437
|
+
|
|
351
438
|
-----------
|
|
352
439
|
### Vscode alternatives
|
|
353
440
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import argparse
|
|
2
2
|
import logging
|
|
3
|
+
import os
|
|
3
4
|
import sys
|
|
4
5
|
|
|
5
6
|
from requests.exceptions import RequestException
|
|
@@ -96,7 +97,12 @@ def main():
|
|
|
96
97
|
property_group.add_argument(
|
|
97
98
|
"--property", help="list of property's", nargs="+", default=[]
|
|
98
99
|
)
|
|
99
|
-
general_group.add_argument(
|
|
100
|
+
general_group.add_argument(
|
|
101
|
+
"file",
|
|
102
|
+
help="http file. use `-` or omit to read http content from stdin",
|
|
103
|
+
nargs="?",
|
|
104
|
+
default=None,
|
|
105
|
+
)
|
|
100
106
|
general_group.add_argument(
|
|
101
107
|
"--target", "-t", help="targets a particular http definition", type=str
|
|
102
108
|
)
|
|
@@ -110,6 +116,13 @@ def main():
|
|
|
110
116
|
# this can be done better by adding validation in add_argument.
|
|
111
117
|
eprint(f"command line property: `{one_prop}` is invalid, expected prop=val")
|
|
112
118
|
sys.exit(1)
|
|
119
|
+
content = None
|
|
120
|
+
if args.file is None or args.file == "-":
|
|
121
|
+
if args.file is None and sys.stdin.isatty():
|
|
122
|
+
parser.error("file is required (or pipe .http content via stdin)")
|
|
123
|
+
content = sys.stdin.read()
|
|
124
|
+
# gives load_content a cwd-based dirname for property-file/import resolution
|
|
125
|
+
args.file = os.path.join(os.getcwd(), "-")
|
|
113
126
|
config = Config(
|
|
114
127
|
curl=args.curl,
|
|
115
128
|
property_file=args.property_file,
|
|
@@ -123,6 +136,7 @@ def main():
|
|
|
123
136
|
format=args.format,
|
|
124
137
|
stdout=args.stdout,
|
|
125
138
|
experimental=args.experimental,
|
|
139
|
+
content=content,
|
|
126
140
|
)
|
|
127
141
|
apply(config)
|
|
128
142
|
|
|
@@ -277,6 +277,9 @@ class BaseModelProcessor:
|
|
|
277
277
|
return
|
|
278
278
|
|
|
279
279
|
def load_content(self):
|
|
280
|
+
if self.args.content is not None:
|
|
281
|
+
self.original_content = self.content = self.args.content
|
|
282
|
+
return
|
|
280
283
|
if not os.path.exists(self.file):
|
|
281
284
|
raise HttpFileNotFoundException(file=self.file)
|
|
282
285
|
with open(self.file, "r", encoding="utf-8") as f:
|
|
@@ -491,7 +491,7 @@ class HttpFileFormatter(RequestBase):
|
|
|
491
491
|
|
|
492
492
|
def run(self):
|
|
493
493
|
formatted = self.format(self.model, property_util=self.property_util)
|
|
494
|
-
if self.args.stdout:
|
|
494
|
+
if self.args.stdout or self.args.content is not None:
|
|
495
495
|
print(formatted)
|
|
496
496
|
else:
|
|
497
497
|
with open(self.args.file, "w") as f:
|
|
@@ -534,6 +534,13 @@ class RequestCompiler(RequestBase):
|
|
|
534
534
|
return resp
|
|
535
535
|
|
|
536
536
|
def print_script_result(self, script_result: ScriptResult):
|
|
537
|
+
if not (
|
|
538
|
+
script_result.stdout
|
|
539
|
+
or script_result.error
|
|
540
|
+
or script_result.properties
|
|
541
|
+
or script_result.tests
|
|
542
|
+
):
|
|
543
|
+
return
|
|
537
544
|
print("\n------------")
|
|
538
545
|
if script_result.stdout:
|
|
539
546
|
print("\n##STDOUT:")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "dothttp-req"
|
|
3
|
-
version = "0.0.
|
|
3
|
+
version = "0.0.44a36"
|
|
4
4
|
description = "Dothttp is Simple http client for testing and development"
|
|
5
5
|
authors = ["Prasanth <kesavarapu.siva@gmail.com>"]
|
|
6
6
|
license = "MIT"
|
|
@@ -29,14 +29,14 @@ requests-pkcs12 = "1.27"
|
|
|
29
29
|
parsys-requests-unixsocket = "0.3.2"
|
|
30
30
|
requests-aws4auth = "1.3.2"
|
|
31
31
|
requests-ntlm = "1.3.0"
|
|
32
|
-
restrictedpython = "8.
|
|
32
|
+
restrictedpython = "8.4"
|
|
33
33
|
faker = "40.21.0"
|
|
34
34
|
requests-hawk = "1.2.1"
|
|
35
35
|
msal = "1.37.0"
|
|
36
36
|
pyyaml = "6.0.3"
|
|
37
37
|
toml = "0.10.2"
|
|
38
38
|
requests = "2.34.2"
|
|
39
|
-
cryptography = "
|
|
39
|
+
cryptography = "50.0.0"
|
|
40
40
|
urllib3 = "2.7.0"
|
|
41
41
|
idna = "3.18"
|
|
42
42
|
xmltodict = "^1.0.2"
|
|
@@ -45,12 +45,12 @@ xmltodict = "^1.0.2"
|
|
|
45
45
|
waitress = "3.0.2"
|
|
46
46
|
flask = "3.1.3"
|
|
47
47
|
python-magic = "^0.4.27"
|
|
48
|
-
flask-cors = "^6.0.
|
|
48
|
+
flask-cors = "^6.0.5"
|
|
49
49
|
pytest = "9.0.3"
|
|
50
50
|
pytest-html = "^4.2.0"
|
|
51
51
|
pytest-xdist = "^3.6.1"
|
|
52
52
|
gunicorn = "^23.0.0"
|
|
53
|
-
httpbin = "^0.10.
|
|
53
|
+
httpbin = "^0.10.4"
|
|
54
54
|
|
|
55
55
|
[build-system]
|
|
56
56
|
requires = ["poetry-core"]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dotextensions/server/handlers/basic_handlers.py
RENAMED
|
File without changes
|
{dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dotextensions/server/handlers/fs_handlers.py
RENAMED
|
File without changes
|
|
File without changes
|
{dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dotextensions/server/handlers/har2httphandler.py
RENAMED
|
File without changes
|
|
File without changes
|
{dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dotextensions/server/handlers/http2postman.py
RENAMED
|
File without changes
|
{dothttp_req-0.0.44a34 → dothttp_req-0.0.44a36}/dotextensions/server/handlers/postman2http.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|