Check-in [529222eb9b]
Overview
Comment: | Add ahttp.get( quieter= ) option for less log.HTTP notices. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
529222eb9b6e9b07b441c2b7e9750271 |
User & Date: | mario on 2015-05-10 22:08:54 |
Other Links: | manifest | tags |
Context
2015-05-10
| ||
22:11 | Move internal commentary out of plugin description block. Try/Catch processing failures in update_rows() loop. Use quieter=1 option for image downloads. Reimplement custom base_url+href favicon patching. check-in: 4e95040e40 user: mario tags: trunk | |
22:08 | Add ahttp.get( quieter= ) option for less log.HTTP notices. check-in: 529222eb9b user: mario tags: trunk | |
19:45 | Work atop Python3 by using io.BytesIO rather than compat2and3 module. check-in: 7ec987b9ba user: mario tags: trunk | |
Changes
Modified ahttp.py from [5b9a02ed1c] to [a2c670d7ab].
1 2 3 4 5 6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | - + | # # encoding: UTF-8 # api: streamtuner2 # type: functions # title: http download / methods # description: http utility |
︙ | |||
49 50 51 52 53 54 55 | 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | + - + + + + + | }) #-- Retrieve data via HTTP # # Well, it says "get", but it actually does POST and AJAXish GET requests too. # def get( |
︙ | |||
73 74 75 76 77 78 79 80 81 82 83 84 85 86 | 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | + | if post: log.HTTP("POST", url, params) r = session.post(url, params=params, headers=headers, timeout=timeout) else: log.HTTP("GET"+(" AJAX" if ajax else ""), url, params ) r = session.get(url, params=params, headers=headers, verify=verify, timeout=timeout) if not quieter: log.HTTP(">>>", r.request.headers ); log.HTTP("<<<", r.headers ); # result log.INFO("Content-Length", len(r.content) ) statusmsg and progress_feedback(statusmsg) if not content: |
︙ |