sync: auto-sync from DESKTOP-0O8A1RL at 2026-05-21 17:00:27

Author: Mike Swanson
Machine: DESKTOP-0O8A1RL
Timestamp: 2026-05-21 17:00:27
This commit is contained in:
2026-05-21 17:00:30 -07:00
parent f1d7b9dfae
commit e3a56bcb21
3 changed files with 6 additions and 53 deletions

View File

@@ -58,21 +58,6 @@ urllib.request.urlopen(req)
"
```
## Sending HTTP requests via Python (avoids backslash hook)
The pre-bash-backslash hook blocks commands with Windows-style backslash paths. Python's `urllib.request` is a clean alternative to curl for sending POST requests that include backslash-containing paths in the payload:
```bash
py -c "
import urllib.request, json
url = 'http://172.16.3.30:8001/api/coord/messages'
data = json.dumps({'to_session': 'target', 'body': 'message'}).encode()
req = urllib.request.Request(url, data=data, headers={'Content-Type': 'application/json'})
resp = urllib.request.urlopen(req)
print(resp.status, resp.read())
"
```
## Unicode in log files
When reading log files that may contain non-UTF8 bytes (Windows logs, PowerShell output):