Skip to content

Instantly share code, notes, and snippets.

@thequbit
Created January 21, 2015 19:19
Show Gist options
  • Save thequbit/701fe54e9a459a569dfb to your computer and use it in GitHub Desktop.
Save thequbit/701fe54e9a459a569dfb to your computer and use it in GitHub Desktop.
=======================================
upload_media.json
POST /upload_media.json HTTP/1.1
Host: anna.duffnet.local:5002
Cache-Control: no-cache
----WebKitFormBoundaryE19zNvXGzXaLvS5C
Content-Disposition: form-data; name="client_id"
1234
----WebKitFormBoundaryE19zNvXGzXaLvS5C
Content-Disposition: form-data; name="media_type"
image
----WebKitFormBoundaryE19zNvXGzXaLvS5C
Content-Disposition: form-data; name="media_file"; filename="IMAG0012.jpg"
Content-Type: image/jpeg
----WebKitFormBoundaryE19zNvXGzXaLvS5C
=======================================
response:
{
"media_id": "6c6751bd-a3ff-484c-baf6-ceca5c88ff24",
"success": true,
"preview_file_name": "fe0fa0c8-239d-4c4a-bbf0-d60e6b4c951dp.jpg",
"file_name": "fe0fa0c8-239d-4c4a-bbf0-d60e6b4c951d.jpg",
"new_user": false,
"error_text": ""
}
=======================================
publish_post.json
POST /publish_post.json HTTP/1.1
Host: anna.duffnet.local:5002
Cache-Control: no-cache
----WebKitFormBoundaryE19zNvXGzXaLvS5C
Content-Disposition: form-data; name="client_id"
1234
----WebKitFormBoundaryE19zNvXGzXaLvS5C
Content-Disposition: form-data; name="language_code"
en
----WebKitFormBoundaryE19zNvXGzXaLvS5C
Content-Disposition: form-data; name="title"
Things that are cool
----WebKitFormBoundaryE19zNvXGzXaLvS5C
Content-Disposition: form-data; name="lat"
44.1
----WebKitFormBoundaryE19zNvXGzXaLvS5C
Content-Disposition: form-data; name="lng"
-77.5
----WebKitFormBoundaryE19zNvXGzXaLvS5C
Content-Disposition: form-data; name="media_objects"
["6c6751bd-a3ff-484c-baf6-ceca5c88ff24"]
----WebKitFormBoundaryE19zNvXGzXaLvS5C
Content-Disposition: form-data; name="assignment_id"
----WebKitFormBoundaryE19zNvXGzXaLvS5C
=======================================
response:
{
"new_user": false,
"post_id": 7,
"success": true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment