Skip to content

Commit d8045d9

Browse files
committed
Removed Expect: 100-continue header from the HTTP request.
1 parent 7970928 commit d8045d9

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

src/main/java/net/authorize/util/HttpClient.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import org.apache.http.conn.params.ConnRoutePNames;
2525
import org.apache.http.entity.StringEntity;
2626
import org.apache.http.impl.client.DefaultHttpClient;
27+
import org.apache.http.params.CoreProtocolPNames;
2728
import org.apache.http.protocol.HTTP;
2829

2930
/**
@@ -68,6 +69,7 @@ private static HttpPost createHttpPost(Environment env, Transaction transaction)
6869
}
6970

7071
httpPost = new HttpPost(postUrl);
72+
httpPost.getParams().setBooleanParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, false);
7173
httpPost.setHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");
7274
httpPost.setEntity(new StringEntity(transaction.toNVPString()));
7375
} else if (transaction instanceof net.authorize.arb.Transaction ||
@@ -76,6 +78,7 @@ private static HttpPost createHttpPost(Environment env, Transaction transaction)
7678

7779
postUrl = new URI(env.getXmlBaseUrl() + "/xml/v1/request.api");
7880
httpPost = new HttpPost(postUrl);
81+
httpPost.getParams().setBooleanParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, false);
7982
httpPost.setHeader("Content-Type", "text/xml; charset=utf-8");
8083
httpPost.setEntity(new StringEntity(transaction.toXMLString()));
8184
}

src/main/java/net/authorize/util/HttpUtility.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import org.apache.commons.logging.LogFactory;
2424
import org.apache.http.client.methods.HttpPost;
2525
import org.apache.http.entity.StringEntity;
26+
import org.apache.http.params.CoreProtocolPNames;
2627

2728
/**
2829
* Helper methods for http calls
@@ -59,6 +60,7 @@ static HttpPost createPostRequest(Environment env, ANetApiRequest request) throw
5960
logger.debug(String.format("MerchantInfo->LoginId/TransactionKey: '%s':'%s'", request.getMerchantAuthentication().getName(), request.getMerchantAuthentication().getTransactionKey() ));
6061
logger.debug(String.format("Posting request to Url: '%s'", postUrl));
6162
httpPost = new HttpPost(postUrl);
63+
httpPost.getParams().setBooleanParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, false);
6264
httpPost.setHeader("Content-Type", "text/xml; charset=utf-8");
6365

6466
String xmlRequest = XmlUtility.getXml(request);

0 commit comments

Comments
 (0)