Upload args: {'publicly_visible': 'y', 'allow_modifications': 'd', 'allow_commercial_use': 'd'}
Python: {'publicly_visible': 'y', 'allow_modifications': 'd', 'session': 'YYY', 'allow_commercial_use': 'd'}
Sending json: {"publicly_visible": "y", "allow_modifications": "d", "session": "YYY", "allow_commercial_use": "d"}
Sending to URL:
http://nova.astrometry.net/api/uploadGot json: {"status": "success", "subid": 128115, "hash": "094e25d1cf7028e037cacd81a608c6c12c42665e"}
Got result: {'status': 'success', 'subid': 128115, 'hash': '094e25d1cf7028e037cacd81a608c6c12c42665e'}
Got status: success
To upload a file, instead of sending an x-www-form-encoded message, you have to send a multipart/form-data message, exactly like a normal HTML form with a text field and a file upload.
The first part should be "text/plain", with "Content-disposition: form-data; name="request-json" ", and the JSON as the body.
The second part should be "octet-stream", with "Content-disposition: form-data; name="file"; filename="ZZZ" "
cheers,
--dustin