cancel
Showing results for 
Search instead for 
Did you mean: 

Status 411 Error when doing a POST using HTTP

hsonnenahalli
Contributor
0 Kudos

Dear Experts-

I am working on a scenario in which I need to retrieve the Access Token for which I need to perform an HTTP POST and then pass the token value to the next flow. I am trying to validate the credentials using SAP cloud platform integration services. I have built a sample integration flow and when trying to do a post am receiving status 411. I think this is content-length. The same query is working in POSTMAN client and is able to retrieve the access token. I am not sure if this is a limitation of standard HTTP adapter or is there a setting which can be done to resolve this issue. I have following configurations. I have also tried to use Content_Length in content modifier and providing length value as 128 MB. No luck.

Appreciate the support.

Regards

HS

MortenWittrock
Active Contributor
0 Kudos

Hi Hari. Leaving this as a comment: Keep in mind that Content-Type is a request header; it doesn't go in the query string. Regards, Morten

Accepted Solutions (1)

Accepted Solutions (1)

hsonnenahalli
Contributor

I resolved the issue. The issue was with HTTP adapter in HCI, as it was expecting a body though it is technically not needed. In content modifier step provided a dummy body and it was sucessfully. I have mentioned the same to SAP as a HTTP bug. Hope they resolve this issue in future.

Thanks for all the support as always.

Regards

HS

0 Kudos

Hi Hari,

Now can you make a request-reply flow successfully to an external server via HTTP POST with body given in Sender URL Body? I know hard-code the request body in Content-Modifier works.

Regards,

Guoquan

Answers (5)

Answers (5)

former_member254404
Participant

Dear Hari,

I am also trying to fetch token details, i done with the same configuration what you have done and same in content modifier i am passing the dummy value. now i am getting HTTP status code 400 error.

In POSTMAN I am able to fetch the token details.

CPI HTTP Configuration :

Content-Modifier passing dummy data:

Regards,

Pradeep Kumar. A

0 Kudos

Hi

I am having the same issue. Can you please share how you resolved this.

hsonnenahalli
Contributor
0 Kudos

Is your API call working in POSTMAN? If yes then please send me the details. I will check on my side.

Regards

HS

NickSYYang
Active Participant
0 Kudos

Thank you Hari.

This trick doesn't work to me.

NickSYYang
Active Participant
0 Kudos

Hi Hari,

I am encountering the exactly same error (HTTP error 411) while doing HTTP POST.

You said you fixed it by providing dummy body.

What does that mean?

I added one "Content Modifier" step before call HTTP POST with no value in the message body box.

But still got same error. What else I can try?

Thanks.

Regards,

Nick

hsonnenahalli
Contributor
0 Kudos

Add hello in body of content modifier.

Regards

HS

DivijaKN
Advisor
Advisor
0 Kudos

Hi Hari,

I don't clearly understand the question. But if the call is working through Postman and not through CPI Ifow, then may be some headers are set. You can refer to the below blog to clear them:

https://blogs.sap.com/2018/01/18/sap-cpi-clearing-the-headers-reset-header/

hsonnenahalli
Contributor
0 Kudos

Thanks for the response but if you look at the error below. The error is complaining about the Content-Length. That is the reason why am receiving the status code 411. The HTTP requests are built as expected. The below query will not work as have masked the credentials. The point is why HTTP adapter is throwing 411 error.

org.apache.camel.component.ahc.AhcOperationFailedException: HTTP operation failed invoking https://api.nfl.com/v1/oauth/token?Content-Type=application/x-www-form-urlencoded&grant_type=client_... with status code: 411