codebased
codebased

Reputation: 7073

Postman | Error: Parse Error: Invalid character in chunk size

I am using Postman to send a request that takes xml in the body request and return xml in the response. I have set my accept as / because I want to accept anything that server can give.

However, for whatever reason, randomly I am getting the following error in the Postman console:

Error: Parse Error: Invalid character in chunk size

I cannot seem to be able to see the raw response in postman through tests section. How do I know if there is some invalid character somewhere?

Any suggestion, why it will work sometime and sometime it will not for the same request and response.

GET https://localhost:44368/turtle
Error: Parse Error: Invalid character in chunk size
Request Headers
SOAPAction: http://asdfas
x-commbank-entity: asdf
Content-Type: text/xml;charset=UTF-8
destination: https://asdfada
Authorization: Basic asdfadsfsaf=
User-Agent: PostmanRuntime/7.29.0
Accept: */*
Cache-Control: no-cache
Postman-Token: bdb896c6-cd6a-469e-b7fe-7f33dfdca942
Host: localhost:44368
Connection: keep-alive
Request Body

Upvotes: 3

Views: 12336

Answers (3)

nyoman.id
nyoman.id

Reputation: 65

I was tried Laith answer, It actually works. But, I can't use the response as value in another API request.

Instead of that, I recommend using return json_decode($response->getBody())

Upvotes: 0

Laith Alhatabeh
Laith Alhatabeh

Reputation: 11

In my case,I am using lumen a microservice of laravel.I was using guzzle for passport response, i have changed the value of what the login function is returning inside my controller.I have changed to return $guzzleResponse->withoutHeader('Transfer-Encoding'); instead of return $guzzleResponse; ,and it worked successfully.

Upvotes: 1

codebased
codebased

Reputation: 7073

It turns out that the way API was written, it was returning duplicate header key. The moment I distinct, it worked.

Upvotes: 4

Related Questions