1
0
mirror of https://github.com/httpie/cli.git synced 2025-08-10 22:42:05 +02:00

Refactored @mmb's fix to --verify; updated docs.

Closes #32.
This commit is contained in:
Jakub Roztocil
2012-04-11 12:44:02 +02:00
parent 71d21d1feb
commit c6c1489212
3 changed files with 16 additions and 14 deletions

View File

@@ -131,13 +131,6 @@ def main(args=None,
elif not files and 'Content-Type' not in headers:
headers['Content-Type'] = TYPE_FORM
if args.verify == 'yes':
verify = True
elif args.verify == 'no':
verify = False
else:
verify = args.verify
# Fire the request.
try:
response = requests.request(
@@ -145,7 +138,7 @@ def main(args=None,
url=args.url if '://' in args.url else 'http://%s' % args.url,
headers=headers,
data=data,
verify=verify,
verify={'yes': True, 'no': False}.get(args.verify, args.verify),
timeout=args.timeout,
auth=(args.auth.key, args.auth.value) if args.auth else None,
proxies=dict((p.key, p.value) for p in args.proxy),