If debug>2, log the URL when posting.

This will work for any RESTful uploader that uses
method `post_request`.
This commit is contained in:
Tom Keffer
2022-10-04 05:55:50 -07:00
parent 501b6d9d21
commit 065b2ac7ee
2 changed files with 3 additions and 1 deletions

View File

@@ -533,6 +533,8 @@ class RESTThread(threading.Thread):
"""
# Data might be a unicode string. Encode it first.
data_bytes = six.ensure_binary(data) if data is not None else None
if weewx.debug >= 2:
log.debug("%s url: '%s'", self.protocol_name, request.get_full_url())
_response = urllib.request.urlopen(request, data=data_bytes, timeout=self.timeout)
return _response

View File

@@ -67,7 +67,7 @@ version = 4.9.0b1
[[StationRegistry]]
# To register this weather station with weewx, set this to true,
# then fill out option 'station_url' above.
# then fill out option 'station_url', located in the [Station] section above.
register_this_station = false
[[AWEKAS]]