pluto
pluto copied to clipboard
0 bytes in the Request Body even though the log shows the actual request body (see screenshot)
trafficstars
Describe the bug
Request Body shows 0 bytes in POST method with multipart/form-data
To Reproduce
Go to Network Calls and click POST API, and see details.
Expected behavior
It should be showing the body data instead.
Screenshots
REQUEST: <https URL>
METHOD: HttpMethod(value=POST)
COMMON HEADERS
-> Accept: application/json
-> Accept-Charset: UTF-8
-> Authorization: Bearer 871|JJ12tnumAFwAhZcJW6TPP3XrC0XUfSL2LAk37CV3f11443ce
-> Connection: close
CONTENT HEADERS
-> Content-Length: 242
-> Content-Type: multipart/form-data; boundary=46ba70a15370f0b-53c81418d4885d8-4995e411-7b761d8e-785e637348a0e64d-4b0
BODY Content-Type: multipart/form-data; boundary=46ba70a15370f0b-53c81418d4885d8-4995e411-7b761d8e-785e637348a0e64d-4b0
BODY START
--46ba70a15370f0b-53c81418d4885d8-4995e411-7b761d8e-785e637348a0e64d-4b0
Content-Disposition: form-data; name=full_name
Content-Length: 20
test sp m+1 asdfasdf
--46ba70a15370f0b-53c81418d4885d8-4995e411-7b761d8e-785e637348a0e64d-4b0--
BODY END
2024-01-30 17:19:46.490 5843-5918 KtorHttpLogger com.bwc.forlance I RESPONSE: 200 OK
METHOD: HttpMethod(value=POST)
FROM: <https URL>
COMMON HEADERS
-> access-control-allow-headers: Content-Type, Authorization
-> access-control-allow-methods: POST, GET, OPTIONS
-> access-control-allow-origin: *
-> cache-control: no-cache, private
-> connection: close
-> content-type: application/json
-> date: Tue, 30 Jan 2024 10:19:46 GMT
-> server: Apache/2.4.54 (Ubuntu)
-> transfer-encoding: chunked
-> vary: Authorization
-> x-android-received-millis: 1706609986486
-> x-android-response-source: NETWORK 200
-> x-android-selected-protocol: http/1.1
-> x-android-sent-millis: 1706609986236
-> x-ratelimit-limit: 60
-> x-ratelimit-remaining: 57
BODY Content-Type: application/json
BODY START
{"status":"success","message":"Service provider profile updated successfully"}
BODY END
Smartphone (please complete the following information):
- Device: Google Pixel 4
- OS: Android 11
- Browser: Default Chrome Emulator
- Library Version: 2.2.1
Additional context
lmk if you need me to create a sample project, because this large project, it takes while to remove confidential things.
turns out this also happened for the Response Body, not only Request Body
Are you using ktor with the okhttp engine?
yes, I'm using ktor