Disable header content-length

Hello, Im trying to remove content-length from http request, how I do it?
Im getting error “the given data is invalid”.

image

That seems to be added by Axios automatically. I have never seen an API that errors because of the content-length. Are you sure the API is erroring because of the content-length? Is it possible that the error it’s because the body is incorrect?

I have already corrected the body data

First, I apologize for the problem (error, inconvenience, inconvenience) that occurred on the platform.

​I want you to know that we are always working to improve the experience of our customers, especially special customers like you!

The error you are getting is invalid data, we did the test by sending the same payload to our system and got this answer:

{

“message”: “The given data was invalid.”,

“errors”: {

“customer”: [

“Customer field is required.”

],

“customer.first_name”: [

“The customer.first name field is required.”

],

“customer.phone”: [

“The customer.phone field is required.”

],

“order”: [

“The order field is required.”

],

“order.delivery”: [

“The order.delivery field is required.”

],

“order.delivery.description”: [

“The order.delivery.description field is required.”

],

“order.delivery.fee”: [

“The order.delivery.fee field is required.”

],

“order.discount”: [

“The order.discount field is required.”

],

" order.id ": [

“The order.id field is required.”

],

“order.products_total”: [

“The total order.products field is required.”

],

“order.total”: [

“The order.total field is required.”

]

}

}

However, removing the Content-Length , which was passed in your Header , we will get the following answer:

{

“message”: “The given data was invalid.”,

“errors”: {

“customer.phone”: [

“customer.phone must be a valid telephone number in the international format (+5531991234567).”

],

" order.products.0.name ": [

“The order.products.0.name field cannot be longer than 50 characters.”

],

" order.products.1.name ": [

“The order.products.1.name field cannot be longer than 50 characters.”

]

}

}

Basically the invalid data error is related to Content-Length and some data with validation error , just correct them as mentioned above and it will be possible to send the events to your API store.

​Any questions we are at your disposal, thank you and good sales!

What is the API you are connecting to? I have never seen a content-length header cause an issue and ideally it should be there for validation.