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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user