Browse Source

small changes to debug output, calling it a day

master
rra 4 years ago
parent
commit
65ee26522c
  1. 4
      basic_ap.py

4
basic_ap.py

@ -117,7 +117,7 @@ def sign_header(private_key, keyID, host, messageBodyJsonStr):
'headers': ' '.join(signedHeaderKeys),
'signature': signature
}
signatureHeader = ','.join(
signatureHeader = ', '.join(
[f'{k}="{v}"' for k, v in signatureDict.items()])
@ -172,7 +172,7 @@ def post():
r = requests.post('https://post.lurk.org/inbox', json=json_message, headers=signed_headers)
html = f'Status code <pre>{r.status_code}</pre></br>Response Headers: <pre>{r.headers}</pre></br></br> json message: <pre>{json.dumps(json_message)}</pre></br></br> Request headers: <pre>{signed_headers}</pre>'
html = f'Status code <pre>{r.status_code}</pre></br>Response Headers: <pre>{r.headers}</pre></br></br> json message: <pre>{r.request.body}</pre></br></br> Request headers: <pre>{r.request.headers}</pre>'
html_headers = f'<html><head><style>pre {{overflow:auto;background-color:#eee;}}</style></head><body>{html}</body></html>'
return html_headers

Loading…
Cancel
Save