2014-03-26 94 views
3

我正在嘗試使用Apache httpclient。 我有一個httppost查詢。 要構建我的對象,我使用由chrome開發人員工具提供的信息。 當我連接服務器時,我看到一個http post請求和有效負載下的信息: 7 | 0 | 10 | http://sfe.corpe15.com:8980/etrading/etrading/|0A6AA27FE80C74E3200C24AA537362BD|com.gwtplatform.dispatch.shared.DispatchService|execute|HttpClient,httppost和有效載荷

在Java中如何轉換?我如何在我的httppost對象中發送有效載荷?

謝謝!

回答

5

我想通了!它看起來像這樣!

String payLoadLogin = "blahblahblah" 

HttpPost httppost = new HttpPost(postAddress); 
httppost.setHeader("X-GWT-Permutation", "3DE824138FE65400740EC1816A73CACC"); 
httppost.setHeader("Content-Type", "text/x-gwt-rpc; charset=UTF-8"); 
StringEntity se = new StringEntity(payLoadLogin);  
httppost.setEntity(se);