A
A
Andrey Kapustin2017-09-14 00:10:31
API
Andrey Kapustin, 2017-09-14 00:10:31

Instagram Private API: "upload/photo" method returns 502. What's wrong?

I send a request with the following content:

POST https://i.instagram.com/api/v1/upload/photo/ HTTP/1.1
Host: i.instagram.com
Accept: */*
X-IG-Capabilities: 3Q4=
User-Agent: Instagram 10.26.0 Android (18/4.3; 320dpi; 720x1280; Xiaomi; HM 1SW; armani; qcom; en_Us)
Content-Type: multipart/form-data, boundary=08115eb7e9ab4b2d91cbd909da597f68
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US
X-IG-Connection-Type: WIFI
Cookie: sessionid=IGSCe75d8682d023c3fb49d8f36d6b3baaa1d65fb1de6ec3a2e60093609dc641736b%3AZysYKn402331ai9xkWQurrCSdvV4sW5g%3A%7B%22_auth_user_id%22%3A5967392865%2C%22[...]
Connection: close
Cookie2: $Version=1
Content-Length: 76564

--08115eb7e9ab4b2d91cbd909da597f68
Content-Disposition: form-data; name="upload_id"

1505336507000
--08115eb7e9ab4b2d91cbd909da597f68
Content-Disposition: form-data; name="_uuid"

08115eb7e9ab4b2d91cbd909da597f68
--08115eb7e9ab4b2d91cbd909da597f68
Content-Disposition: form-data; name="_csrftoken"

uHAooP90MsX2WM5ezH697IJFTjFaZURR
--08115eb7e9ab4b2d91cbd909da597f68
Content-Disposition: form-data; name="image_compression"

{"lib_name":"jt","lib_version":"1.3.0","quality":"87"}
--08115eb7e9ab4b2d91cbd909da597f68
Content-Disposition: form-data; name="photo"; filename="pending_media_1505336507000.jpg"
Content-type: image/jpeg
Content-Transfer-Encoding : binary

FFD8FFE000104A46494600010101006000600000FFE100E645786966000049492A00080000000[...]

--08115eb7e9ab4b2d91cbd909da597f68--

In response, I get "HTTP/1.1 502 Bad Gateway".
Colleagues, what could be the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Kapustin, 2017-09-15
@akap

Error in header parameter "Content-type"
Instead of erroneous value

multipart/form-data[,] boundary=08115eb7e9ab4b2d91cbd909da597f68

You must send the correct
multipart/form-data[;] boundary=08115eb7e9ab4b2d91cbd909da597f68

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question