前两天在工作中,项目组长给我了一个远程接口让我给测一下,因为是http协议,所以我首先想到了用httpClient工具类来测试,网上一查,找到了好多示例代码,随便复制了一个demo进行了简单的修改,结果怎么测试都是连接超时,试了很多个demo也不好使,最后发现是因为我们公司访问外网是通过代理,所以在进行测试的时候需要配置代理。一下是我的测试程序

用到的jar包:

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAARMAAADcCAIAAADcAtI6AAAX7UlEQVR4nO2d7XPURp7H+0/Iv3DJJa8hwa5Bf0hS4ZILMV693LzcglSycLhCYUxWm9sc5GF3L1W3gRAXsXHQ4oTLLltwRUIwT8YGtMY8ODbg8dhm7HmwZ+h7oaeW1NLIPT0eSfP9VBclWr9+kN1fq0ej/jahMvj25yenx/IzhfWnFYqUsTRTWD89lv/25ydShkpmIFJq6R+6u7BaXyjR/CrNr9KxM+98d+Sl0f968czHL/71oxdP//6Fkd+9cOrw88MDz4+deceMQUpLWijRhdV6/9BdKUMlM8hRTt/g1HKFzq9Y6bsjLz2rLz5bm62Xb9ef/lRbGK0/+qo288n6vYHvjrzkhCGlJS1XaN/glJShkhmkKWepTB8XreS55/znv57+/Qvf/u75U4efHx74l7Ez7zhhSI9PqqRbu9iWpq9p24iy/1qs4KUylONHmnIWy/TRUyvdnVnY/fGZu3PF5dXq8mp1bW1tebVyd664++Mzd2cWnDCkR4Mq6dYuNl8JIW8O8k5d0bYRE+U/rgRPBTJD0iKUEyCuci5cuLCyshJ2tm9wqlCis0/p7FN6/ur0wF/OP5gv5ZfLxVKlWKqUq9ViqTq/XH4wXxr4y/nzV6fNSKTZQZV0axfEazD2dRPSrb7RTd4YDJ7V3yB2fnMNFUpQjp+4yvnyyy+PHz+ez+e5Z/sGpxZW6cwSnVmiX4xcOn524mG+VChWypVquVKt19bKlWrhaWUmXzp+duKLkUtmJNLM1yrp1s43W4+xt5v829fRlRt7u5W9Y4JNLKxCOX42oJwnT5589tlnMzMzwbN9g1PzK/T+Ir2/SPs+//6HsYcP5kvzy5W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ZK/pk9y30BbSIYPQZJX3ie5b6B9YH0OACJAOQCIAOUAIAKUA4AIUA4AIsCHAAAR4EMAgAgd4kPgfRG6Adb7Nen7Bgff124iGfUh8LMB5WzeezYwS0gzmfQhCBKtHI9YYuzDLgWYJaSbDPoQ8EiccmCWkHYy5kPA+AF4whjl+CthdqB22wyuOWXb9LkO6CpRNN2qVtXdQqEKhFlC+smgD4FHL26FDVwEePccd1fcYLx3Z1I7ztRMgzU7MEvIApnyIQgMLXYlZ1wXAbft0IEZMYBD97h2OgmzhGyQJR+C4ImAcmK4CEQqh6vPGHtce3voB2YJKSRjPgSeM8x/bOXEcBGImq3xhbsh5XiAWUJ6yZgPgaEpRFUDDwjYzzm8Sqxczqf2iCcElImRqByYJaSDjPkQdPbg6Oyr32Qy5kPQ0WMHrxBsJhnzIehU5cAsYdPB+hwARIByABABygFABCgHABGgHABEgA8BACLAhwAAEZLkQ5B28E1kJ5EkH4JNI3qFnPBZKKeT6BAfAhZdZd8m9Y//Zs6CDqJDfAjC8Cybk3oWZJwk+RBQ6lk+qamcN+t9a5g5mTwDg6jmIu4bGzwLG4BOIkk+BB57AWZZI3fWxHcI4BoYhBK9gGbDZ2ED0EkkyYfANxg9y5q9f6hDF+Bzl8Txrf2i7cpEzsIGoJNIkg9BqHJMzKHIdVtiRcK3/gg2JVk2FDYAnUWSfAjCZ2ua56MCDXcIiKMc3jTOu5hZ8CxsADqJJPkQUM/6efYJQdB6MOoJQbRy2HLOFM4Z/c2chQ1AJ5EkHwIfm2XwLA1Io5NIkA8BpYameB46p0846eoxaIJk+BA4MA+k0jQIYQPQeWB9DgAiQDkAiADlACAClAOACP8PE2iKZp2/5dYAAAAASUVORK5CYII=" alt="" />

 package com.lym.test;

 import org.apache.http.HttpEntity;
import org.apache.http.HttpHost;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils; import com.google.gson.JsonObject; public class HttpClientTest { public static void main(String args[]) throws Exception { // 创建HttpClientBuilder
HttpClientBuilder httpClientBuilder = HttpClientBuilder.create();
// HttpClient
CloseableHttpClient closeableHttpClient = httpClientBuilder.build();
// 依次是目标请求地址,端口号,协议类型
HttpHost target = new HttpHost("61.144.244.6:8888/sztmerchant/merchant/addIsztMerchant.htm", 8888, "http");
// 依次是代理地址,代理端口号,协议类型
HttpHost proxy = new HttpHost("proxy3.bj.petrochina", 8080, "http");
RequestConfig config = RequestConfig.custom().setProxy(proxy).build(); // 请求地址
HttpPost httpPost = new HttpPost("http://61.144.244.6:8888/sztmerchant/merchant/addIsztMerchant.htm");
// 设置头信息
httpPost.addHeader("Content-type", "application/json; charset=utf-8");
httpPost.setHeader("Accept", "application/json");
httpPost.setConfig(config); // 创建参数json串
JsonObject jsonObj = new JsonObject();
jsonObj.addProperty("merchantNo", "33300911238");
jsonObj.addProperty("merchantName", "电商运营生产测试1238");
String jsonStr = jsonObj.toString();
System.out.println("parameters: " + jsonStr); StringEntity entity;
try {
entity = new StringEntity(jsonStr, "UTF-8");
httpPost.setEntity(entity);
CloseableHttpResponse response = closeableHttpClient.execute(target, httpPost);
// getEntity()
HttpEntity httpEntity = response.getEntity();
if (httpEntity != null) {
// 打印响应内容
System.out.println("result: " + EntityUtils.toString(httpEntity, "UTF-8"));
}else {
System.out.println("无响应内容");
}
// 释放资源
if(closeableHttpClient != null) {
closeableHttpClient.close();
}
} catch (Exception e) {
e.printStackTrace();
}
} }

使用HttpClient进行远程接口测试的更多相关文章

  1. HttpClient实现远程调用

           在项目中,我们常常遇到远程调用的问题,一个模块总是无法单独存在,总需要调用第三方或者其他模块的接口.这里我们就涉及到了远程调用. 原来在 ITOO中,我们是通过使用EJB来实现远程调用的 ...

  2. HttpClient + Testng实现接口测试

    HttpClient教程 : https://www.yeetrack.com/?p=779 一,所需要的环境: 1,testng .httpclient和相关的依赖包 二.使用HttpClient登 ...

  3. HttpClient远程接口调用-实名认证

    1.HttpClient远程接口调用 1)用户注册 注册按钮button提交表单时,要return false form表单 <!-- action="http://localhost ...

  4. 飞信免费发送接口API的测试 httpClient

    测试飞信免费发送接口API的测试(HTTPClient实现) 使用优点:快捷,方便 使用缺点:用户的各种信息以明文形式在网络中传输不安全. 仅仅用于测试 package cn.com.vnvtrip. ...

  5. 在Core环境下用WebRequest连接上远程的web Api 实现数据的简单CRUD(续)

    这篇博客是上篇博客的续写,上篇博客用的是HttpClient取远程数据,用WebRequest提交,更新,删除数据.上篇本来想全文都用httpClient,可是当时无论如何也实现不了数据的提交,于是换 ...

  6. SpringBoot关于系统之间的远程互相调用

    1.SpringBoot关于系统之间的远程互相调用 可以采用RestTemplate方式发起Rest Http调用,提供有get.post等方式. 1.1远程工具类 此处使用Post方式,参考下面封装 ...

  7. Task.Delay方法的2个应用实例,单元测试等待,限时限次下载远程资源

    如果想让程序异步等待一段时间,可以考虑使用Task.Delay方法. 比如,在单元测试中模拟一个异步操作. static async Task<T> DelayedResult<T& ...

  8. webservice的接口协议(HTTPClient 、RestTemplate HttpURLConnection)

    HTTP协议时Internet上使用的很多也很重要的一个协议,越来越多的java应用程序需要通过HTTP协议来访问网络资源. HTTPClient提供的主要功能: 1.实现了所有HTTP的方法(GET ...

  9. RestTemplate配置

    什么是RestTemplate? RestTemplate是Spring提供的用于访问Rest服务的客户端,RestTemplate提供了多种便捷访问远程Http服务的方法,能够大大提高客户端的编写效 ...

随机推荐

  1. Android 验证APK是否已经签名或是否是Debug签名

    https://source.android.google.cn/ http://www.android-doc.com/tools/publishing/app-signing.html Signi ...

  2. Word 2010 制作文档结构之图标自动编号设置

    注意: 使用图片自动编号时,如果文档标题使用的样式是通过“将所选内容保存为新快速样式”所生成的样式,则图片自动编号不会生效 因此设置标题样式时,不要 新建样式,直接使用word预设的“标题 1”样式和 ...

  3. 使用virtualbox 配置 linux host-only虚拟主机连接外网(转载)

    host-only 下的虚拟机之间可以互相访问,虚拟机和宿主机可以互相访问,但是虚拟机不能访问外网. 需要设置: 1.宿主机设置 先对宿主机(windows机器,我这里是win7系统)进行相关配置. ...

  4. vue2.0在table中实现全选和反选

    其实在去年小颖已经写过一篇:Vue.js实现checkbox的全选和反选 小颖今天在跟着慕课网学习vue的过程中,顺便试试如何在table中实现全选和反选,页面的css样式是直接参考慕课网的样式写的, ...

  5. sencha touch Ext.app.Application

    Ext.app.Application一般用于app.js中 用来初始化整个应用 可以预先加载controllers(控制器),models(模型),stores(数据源),views(视图) 例如: ...

  6. 2555: SubString[LCT+SAM]

    2555: SubString Time Limit: 30 Sec  Memory Limit: 512 MB Submit: 2601  Solved: 780 [Submit][Status][ ...

  7. Android 浅谈 设计与屏幕适配 【1.6235449734285716】

    extends: http://www.ui.cn/detail/45435.html http://www.2cto.com/kf/201501/372699.html http://www.cnb ...

  8. Xcode - 打开工程,提示No Scheme解决

    错误提示,如图: 解决思路:

  9. Zookeeper可以干什么

    在Zookeeper的官网上有这么一句话:ZooKeeper is a centralized service for maintaining configuration information, n ...

  10. Swift 使用 LLDB 调试命令

    swift 和 oc 的语法不一样: Xcode 调试技巧之 Swift 篇 打印和赋值,观察数值变量和view对象属性 p指令可打印其对象类型.内存地址以及该对象的值等具体信息, po指令则是打印其 ...