当前位置: 首页>>代码示例>>Java>>正文


Java DefaultHttpClient.setCookieStore方法代码示例

本文整理汇总了Java中org.apache.http.impl.client.DefaultHttpClient.setCookieStore方法的典型用法代码示例。如果您正苦于以下问题:Java DefaultHttpClient.setCookieStore方法的具体用法?Java DefaultHttpClient.setCookieStore怎么用?Java DefaultHttpClient.setCookieStore使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.http.impl.client.DefaultHttpClient的用法示例。


在下文中一共展示了DefaultHttpClient.setCookieStore方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: requery

import org.apache.http.impl.client.DefaultHttpClient; //导入方法依赖的package包/类
public static void requery(String tableName,Class clazz,String key) throws ClientProtocolException, IOException, JSONException,Exception {
	Log.i(TAG,"Got key " + key + " but couldn't find related parent tr, requerying ...");
	String url=FLOWZR_API_URL + nsString + "/key/?tableName=" + DatabaseHelper.TRANSACTION_TABLE + "&key=" + key;   				
	StringBuilder builder = new StringBuilder();		
	DefaultHttpClient http_client2= new DefaultHttpClient();
	http_client2.setCookieStore(http_client.getCookieStore());
	HttpGet httpGet = new HttpGet(url);
   	HttpResponse httpResponse = http_client2.execute(httpGet);
       HttpEntity httpEntity = httpResponse.getEntity();
       InputStream content = httpEntity.getContent();
       BufferedReader reader = new BufferedReader(new InputStreamReader(content));
       String line;
       while ((line = reader.readLine()) != null) {
         builder.append(line);
       }
	JSONObject o = new JSONObject(builder.toString()).getJSONArray(DatabaseHelper.TRANSACTION_TABLE).getJSONObject(0);
	saveEntityFromJson(o, tableName, clazz,1);
}
 
开发者ID:tiberiusteng,项目名称:financisto1-holo,代码行数:19,代码来源:FlowzrSyncEngine.java

示例2: create

import org.apache.http.impl.client.DefaultHttpClient; //导入方法依赖的package包/类
@Override
public DefaultHttpClient create(final HttpMethod method, final URI uri) {
    
    final DefaultHttpClient httpClient = super.create(method, uri);

    httpClient.getParams().setParameter(CoreProtocolPNames.USER_AGENT,
            format("SAP CM Client/%s based on %s", CMODataClient.getShortVersion(), USER_AGENT));

    httpClient.setCookieStore(this.cookieStore);

    return httpClient;
}
 
开发者ID:SAP,项目名称:devops-cm-client,代码行数:13,代码来源:CMOdataHTTPFactory.java


注:本文中的org.apache.http.impl.client.DefaultHttpClient.setCookieStore方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。