httpput
String doHttpPut(String rpmName, String cookie) throws UnsupportedEncodingException, IOException, ClientProtocolException, Exception {
HttpPut httpPut = new HttpPut(postURI);
System.out.println("**********************");
httpPut.setHeader("Cookie", cookie);
httpPut.setHeader("Content-Type", "application/json;charset=UTF-8");
httpPut.setEntity(getParamaters(rpmName));
HttpResponse response = getHttpClient().execute(httpPut);
HttpEntity entity = response.getEntity();
String html = EntityUtils.toString(entity);
return html;
}
private StringEntity getParamaters(String rpmName) throws UnsupportedEncodingException {
String componentName = getComName(rpmName);
JSONObject parms = new JSONObject();
parms.put("ffff", componentName);
noChange(parms);
JSONObject subParams = new JSONObject();
subParams.put("ss", componentName);
parms.put("properties", subParams);
String jsonString = parms.toString();
System.out.println(jsonString);
return new StringEntity(jsonString, ContentType.APPLICATION_JSON);
}
httpput的更多相关文章
- Http 四种请求访问代码 HttpGet HttpPost HttpPut HttpDelete .
String url = "http://www.baidu.com"; //将要访问的url字符串放入HttpPost中 HttpPost httpPost= new HttpP ...
- ajax参数传递之[HttpGet]/[HttpPost]/[HttpPut]/[HttpDelete]请求
$.ajax({ type: "get", url: "http://localhost:27221/api/Charging/GetByModel", con ...
- httpClient Post例子,Http 四种请求访问代码 HttpGet HttpPost HttpPut HttpDelete
httpclient post方法 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 //----1. HttpPost request = new HttpPost(ur ...
- springboot~HttpPut开启application/x-www-form-urlencoded
在使用spring框架时,默认情况下@RequestParam注解只到接受Get和Post请求参数 ,而对于Put来说默认是使用@ReqeustBody注解的,如果希望为Put也开启@RequestP ...
- ABP框架没有httpPost,httpget,httpput特性
需要引用一下组件, Microsoft.AspNetCore.Mvc
- C# WebAPI项目,不支持HttpPut请求!!!
有点标题党了,这个异常的现象是这样的: 我有一个正在跑的项目,要对接第三方厂家的设备. 对方给的接口文档,里面有一个接口是需要我这边实现的,要求必须是PUT请求方式. 所以我在项目基础上,新增一个W ...
- bootstrap + requireJS+ director+ knockout + web API = 一个时髦的单页程序
也许单页程序(Single Page Application)并不是什么时髦的玩意,像Gmail在很早之前就已经在使用这种模式.通常的说法是它通过避免页面刷新大大提高了网站的响应性,像操作桌面应用程序 ...
- 我这么玩Web Api(二):数据验证,全局数据验证与单元测试
目录 一.模型状态 - ModelState 二.数据注解 - Data Annotations 三.自定义数据注解 四.全局数据验证 五.单元测试 一.模型状态 - ModelState 我理解 ...
- 我这么玩Web Api(一):帮助页面或用户手册(Microsoft and Swashbuckle Help Page)
前言 你需要为客户编写Api调用手册?你需要测试你的Api接口?你需要和前端进行接口对接?那么这篇文章应该可以帮到你.本文将介绍创建Web Api 帮助文档页面的两种方式,Microsoft Help ...
随机推荐
- python之路--迭代器和生成器
迭代: 迭代器协议: 1.迭代器协议是指:对象必须提供一个next方法,执行该方法要么返回迭代中的下一项,要么就引起一个StopIteration异常,以终止迭代 (只能往后走不能往前退) 2.可迭代 ...
- [BZOJ2427]软件安装
Problem 每个软件都要安装某些软件才能安装,而且都有体积和价值,求安装的价值最大值 Solution 对于每个环,我们可以知道必须全部一起取或者不取,因此我们先用Tarjan缩点 然后我们用一个 ...
- nginx概述
1)nginx的特性: 模块化设计,较好的扩展性 高可靠性 master/worker 支持热部署 不停机更新配置文件,更换日志,更新服务器程序版本 低内存消耗 支持event-driven,alo, ...
- python魔术方法(__init__,__call__,被双下划线包围的方法)
转载link:http://pycoders-weekly-chinese.readthedocs.io/en/latest/issue6/a-guide-to-pythons-magic-metho ...
- mongoose的关联查询 :populate
mongoose关联查询从3.2版本开始支持 基本用法如下: var studentSchema = new Schema({ name:String, age:String, school:{ ty ...
- TensorFlow函数:tf.random_shuffle
tf.random_shuffle 函数 random_shuffle( value, seed=None, name=None ) 定义在:tensorflow/python/ops/random_ ...
- php \r\n
代码a: 复制代码 代码如下: <?php echo'hello</br>'; echo'world!'; ?> output: helllo world! 代码b: 复制代码 ...
- UA池和代理池
scrapy下载中间件 UA池 代理池 一.下载中间件 先祭出框架图: 下载中间件(Downloader Middlewares) 位于scrapy引擎和下载器之间的一层组件. - 作用: (1)引擎 ...
- Go语言for循环语句
for循环语句解释与使用 首先我们定义sum:=0 格式:for i:=1;i<=100;i++{ sum+=i } for 循环100次,首先执行i=1,然后判断i<100,再执行sum ...
- python要开始记录了20181125
print('1.使用while循环输入 1 2 3 4 5 6 8 9 10') i = 1 while i < 10: i += 1 if i == 7: continue #print(' ...