Commit Graph

38 Commits

Author SHA1 Message Date
Jakub Roztocil
f5bc081fda Send filenames with multipart/form-data file uploads. 2012-07-28 13:24:44 +02:00
Jakub Roztocil
098e1d3100 Fixed multipart requests output; binary support.
* Bodies of multipart requests are correctly printed (closes #30).
* Binary requests and responses should always work (they are also suppressed
  for terminal output). So things like this work::

     http www.google.com/favicon.ico > favicon.ico
2012-07-28 05:50:12 +02:00
Jakub Roztocil
f45cc0eec0 Added docstrings, refactored input. 2012-07-26 07:23:00 +02:00
Jakub Roztocil
26a76e8243 Clean-up 2012-07-26 00:50:39 +02:00
Jakub Roztocil
f5cfd0143b Ensure that full querystring is printent with -v.
The `key==value` parameters weren't included in the Request-Line URL.

Also added tests.
2012-07-25 14:32:57 +02:00
Jakub Roztocil
7af08b6faa Allow multiple fields with the same name.
Applies to form data and URL params:

    http -f url a=1 a=2
    http url a==1 a==2
2012-07-24 17:00:02 +02:00
Jakub Roztocil
9944def703 Switched to "==" a the separator for URL params.
Also refactored item escaping.
2012-07-24 14:56:53 +02:00
Jakub Roztocil
2646ebaaed Replaced --ignore-http-status with --check-status.
The default behaviour now is to exit with 0 on HTTP errors
unless --check-status is set.
2012-07-24 01:09:14 +02:00
Jakub Roztocil
fba3912f2e Fixed tests. 2012-07-23 19:49:38 +02:00
Jakub Roztocil
0572158ba1 Added exit codes for HTTP 3xx, 4xx, 5xx (3, 4, 5).
Also added `--ignore-http-status` to ensure 0 exit status.

HTTP 3xx result in 0 exit status when `--allow-redirects` is set.
2012-07-23 19:40:50 +02:00
Jakub Roztocil
19f760450f Use local httpbin for all tests if available. 2012-07-21 14:37:05 +02:00
Jakub Roztocil
35da44309f Undebug 2012-07-21 03:26:48 +02:00
Jakub Roztocil
ced6e33230 Fixed tests. 2012-07-21 03:22:47 +02:00
Jakub Roztocil
87042f65c9 Added models.Environment().
Refactoring and general cleanup.
2012-07-21 03:14:01 +02:00
Jakub Roztocil
57fc606f6b Changed default --print to "b" if stdout piped.
If the output is piped to another program or redirected to a file,
the new default behaviour is to only print the response body.
(It can still be overriden via the ``--print`` flag.)
2012-07-20 23:43:04 +02:00
Jake Basile
24d6331d15 Added a bit of testing for the new query string parameters. 2012-07-18 21:16:08 -05:00
Jakub Roztocil
c2d70e2bb1 Clean up. 2012-07-17 07:01:30 +02:00
Jakub Roztocil
f29c458611 Python 3 fixes. 2012-07-17 01:26:21 +02:00
Oleg Churkin
df79792fd9 Added test case to verify unicode output 2012-07-17 00:09:01 +02:00
Jakub Roztocil
681b652bf9 Allow stdin data with password prompt; added tests
Closes #70
2012-07-16 23:41:27 +02:00
Jakub Roztocil
6ab03b21b4 Fixed Content-Type for requests with no data.
Closes #62.
2012-07-04 01:39:21 +02:00
Jakub Roztocil
50196be0f2 Added support for request payload from a filepath
Content-Type is detected from the filename.

Closes #57.
2012-06-29 00:45:31 +02:00
Jakub Roztocil
180313d80c Impreved tests. 2012-06-24 04:20:45 +02:00
Jakub Roztocil
926d3f5caf Tests, docs, clean-up.
Closes #54.
2012-06-24 03:45:21 +02:00
Jakub Roztocil
4613d947a8 Default to POST also when stdin redirected.
+clean up
2012-06-24 01:25:30 +02:00
Jakub Roztocil
5a47f00bac Replaced mock.Mock with argparse.Namespace to reduce deps. 2012-06-23 23:54:59 +02:00
Vladimir Berkutov
bca36f0464 Issue #54 Method suggestion proposal 2012-06-17 21:46:56 +04:00
Vladimir Berkutov
78fff98712 Issue #54 Method suggestion proposal 2012-06-16 20:08:31 +04:00
Jakub Roztocil
cbc6d02127 Fixed --verbose --form.
Closes #53
2012-06-15 16:47:55 +02:00
Jakub Roztocil
c5b1aaaa28 Major clean-up and refactoring. 2012-04-25 01:32:53 +02:00
Jakub Roztocil
67d6426360 Fixed several unicode-related issues
Closes #31 Python 3 & non-ascii arguments => UnicodeEncodeError
Closes #41 Unicode response error.
Closes #42 UnicodeEncodeError when piping Unicode output
2012-04-25 00:08:40 +02:00
Jake Basile
90af1f7422 Fixed escaping for long separators. 2012-04-18 18:18:00 -05:00
Jake Basile
c29981c633 Added ability to escape parameters... except for the := ones. 2012-04-16 20:28:08 -05:00
Jake Basile
45ce446017 -j/--json now adds "Accept": "application/json" to GET requests if no previous Accept header exists. 2012-04-14 14:13:53 -05:00
Jakub Roztocil
0c4c6c4753 Added --auth-type and tests for basic/digest auth.
Closes #38.
2012-04-11 13:56:25 +02:00
Jakub Roztocil
51aa0409e6 Added Python 3 support
Closes #11.
2012-03-15 00:13:11 +01:00
Jakub Roztocil
6a1f0248e1 Fixed tests. 2012-03-14 19:21:47 +01:00
Jakub Roztocil
b7e0473d6c Added file upload support
It is now possible to send multipart/form-data requests.

Note that the --file option used previously has been removed
because it didn't allow you specify the field name.

Example:

    http -f POST example.com field-name@/path/to/file
2012-03-14 19:14:37 +01:00