使用HttpClient进行远程接口测试

时间:2022-05-06 12:30:24

前两天在工作中,项目组长给我了一个远程接口让我给测一下,因为是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+xt5v829fRlRt7u5W9Y4JNLKxCOX42oJwnT5589tlnMzMzwbN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h1/57z7Cd/uAIADknyIUjy8Ety30A7SJAPQZK/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&period;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. linq join的lambda写法

    var query = _db.Bank_CommercialOpus .Join(_db.Bank_Opus, s => s.OpusID, Opus => Opus.ID, (s, O ...

  2. u-boot移植总结(一)start&period;S分析

    本次移植u-boot-2010.09是基于S3C2440的FL440板子,板子自带NANDFLASH而没有NORFLASH,所以在U-BOOT启动的过程中必须实现从NANDFLASH到SDRAM的重定 ...

  3. 关于FireFox类VIM插件。VimPerator

    说实话现在一直非常喜欢VIM的那种操控方式.当然我不是一个程序员,只是觉得处理文本的时候,那种效率很快.而且不用来回再鼠标跟键盘之间的切换也让我感觉很舒服. 以前一直在想如果开网页的时候也能那样得话不 ...

  4. Android 滑动效果进阶篇(五)—— 3D旋转

    前面介绍了利用Android自带的控件,进行滑动翻页制作效果,现在我们通过代码实现一些滑动翻页的动画效果. Animation实现动画有两个方式:帧动画(frame-by-frame animatio ...

  5. Html 模态框操作

    <style> #modal-overlay { visibility: hidden; position: absolute; /* 使用绝对定位或固定定位 */ left: 0px; ...

  6. iOS 之 Strong与Weak,&lowbar;unsafe &lowbar;unretained与weak区别

    1. 在ARC中 strong(强引用) 相当于retain, weak(弱引用) 相当于assign.ARC下,strong告诉编译器自动插入retain.但是在ARC下,代理协议的属性依然用ass ...

  7. jmeter 分布式实战

    最近作者在公司部署公司的分布式压力测试情况的时候,遇到了问题,什么问题呢,各种错误,于是大晚上的为了不耽误压测,我们就两个同事两台电脑搞,可是还是不行的呢,我要研究研究这个是什么梗,于是乎,大晚上加班 ...

  8. LXC学习实践(3)快速体验第一个容器

    1.搭建第一个 LXC 虚拟计算机 #yum install lxc* 2.安装软件包后要检查 Linux 发行版的内核对 LXC 的支持情况,可以使用下面命令 #lxc-checkconfig #l ...

  9. Python3 输入和输出

    输出格式美化 Python两种输出值的方式: 表达式语句和 print() 函数.(第三种方式是使用文件对象的 write() 方法; 标准输出文件可以用 sys.stdout 引用.) 如果你希望输 ...

  10. AngularJS中ng-class使用方法

    转自:https://blog.csdn.net/jumtre/article/details/50802136 其他博文ng-class使用方法:https://blog.csdn.net/sina ...