forked from extern/httpie-cli
Added a short timeout for test requests
This commit is contained in:
parent
20f01709ea
commit
d4067fcb6d
@ -287,9 +287,11 @@ If the port is omitted, then port 80 is assumed.
|
||||
|
||||
If you find yourself manually constructing URLs with **querystring parameters**
|
||||
on the terminal, you may appreciate the ``param==value`` syntax for appending
|
||||
URL parameters so that you don't have to worry about escaping the ``&``
|
||||
separators and as well as special character in parameter values.
|
||||
To search for ``HTTPie logo`` on Google Images you could use this command:
|
||||
URL parameters. With that, you don't have to worry about escaping the ``&``
|
||||
separators for you shell. Also, special characters in parameter values,
|
||||
will also automatically escaped (HTTPie otherwise expects the URL to be
|
||||
already escaped). To search for ``HTTPie logo`` on Google Images you could use
|
||||
this command:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
|
@ -185,8 +185,13 @@ def http(*args, **kwargs):
|
||||
stderr = env.stderr
|
||||
|
||||
args = list(args)
|
||||
if '--debug' not in args and '--traceback' not in args:
|
||||
args = ['--traceback'] + args
|
||||
extra_args = []
|
||||
if '--debug' not in args:
|
||||
if '--traceback' not in args:
|
||||
extra_args.append('--traceback')
|
||||
if '--timeout' not in ' '.join(args):
|
||||
extra_args.append('--timeout=3')
|
||||
args = extra_args + args
|
||||
|
||||
def dump_stderr():
|
||||
stderr.seek(0)
|
||||
|
Loading…
Reference in New Issue
Block a user