Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"417: Expectation Failed" on HTTPPost

Very similarly to the Expect Continue problem C# described here, HTTP POST Returns Error: 417 "Expectation Failed.", I was getting an "Expectation Failed" error from the server I was trying to POST to with a HttpPost object in Android.

like image 266
Ivar Vong Avatar asked Dec 05 '22 23:12

Ivar Vong


1 Answers

The equivalent fix to prevent the request from using "expect continue" seems to be this:

httpPostInstance.getParams().setParameter(
    CoreProtocolPNames.USE_EXPECT_CONTINUE,
    Boolean.FALSE);

I found this at http://hc.apache.org/httpcomponents-client-ga/tutorial/html/fundamentals.html under 1.6.1.

like image 163
Ivar Vong Avatar answered Jan 04 '23 09:01

Ivar Vong