我是靠谱客的博主 柔弱枕头,这篇文章主要介绍工作计划:近期工作实用安排,现在分享给大家,希望可以做个参考。

搞搞接口测试的。

  1.输入接口,输入key,输入key的条件

  2.做各种接口请求,查看返回

    • 必传key
    • 选传key

 

    • key值有效
    • key值无效

 

    • 核对返回key

研究天眼的使用,计划怎么将天眼的数据查询做的更方便。

 

1.页面设计

 

2.功能实现

 

  代码实现过程:

  1.http访问页面,获取json后解析

    参考:https://segmentfault.com/a/1190000011212806#articleHeader4

       https://blog.csdn.net/jeanflower/article/details/74494136

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
package chapter17; import com.alibaba.fastjson.JSONObject; import java.io.BufferedInputStream; import java.io.BufferedReader; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.net.HttpURLConnection; import java.net.URL; public class TestGetPost { /** * 发起http请求并获取结果 * @param requestUrl 请求地址 */ public static JSONObject getXpath(String requestUrl){ String res=""; JSONObject object = null; StringBuffer buffer = new StringBuffer(); try{ URL url = new URL(requestUrl); HttpURLConnection urlCon= (HttpURLConnection)url.openConnection(); if(200==urlCon.getResponseCode()){ InputStream is = urlCon.getInputStream(); InputStreamReader isr = new InputStreamReader(is,"utf-8"); BufferedReader br = new BufferedReader(isr); String str = null; while((str = br.readLine())!=null){ buffer.append(str); } br.close(); isr.close(); is.close(); res = buffer.toString(); // JsonParser parse =new JsonParser(); // object = (JsonObject) parse.parse(res); JSONObject jsonObject = JSONObject.parseObject(res); } }catch(IOException e){ e.printStackTrace(); } return object; } public static JSONObject postDownloadJson(String path,String post){ URL url = null; try { url = new URL(path); HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection(); httpURLConnection.setRequestMethod("POST");// 提交模式 // conn.setConnectTimeout(10000);//连接超时 单位毫秒 // conn.setReadTimeout(2000);//读取超时 单位毫秒 // 发送POST请求必须设置如下两行 httpURLConnection.setDoOutput(true); httpURLConnection.setDoInput(true); // 获取URLConnection对象对应的输出流 PrintWriter printWriter = new PrintWriter(httpURLConnection.getOutputStream()); // 发送请求参数 printWriter.write(post);//post的参数 xx=xx&yy=yy // flush输出流的缓冲 printWriter.flush(); //开始获取数据 BufferedInputStream bis = new BufferedInputStream(httpURLConnection.getInputStream()); ByteArrayOutputStream bos = new ByteArrayOutputStream(); int len; byte[] arr = new byte[1024]; while((len=bis.read(arr))!= -1){ bos.write(arr,0,len); bos.flush(); } bos.close(); return JSONObject.parseObject(bos.toString("utf-8")); } catch (Exception e) { e.printStackTrace(); } return null; } //测试 public static void main(String [] args) { // res = getXpath("http://ip.taobao.com/service/getIpInfo.php?ip=63.223.108.42"); JSONObject res = postDownloadJson("http://ip.taobao.com/service/getIpInfo.php?ip=63.223.108.42","123"); System.out.println(res); System.out.println(res.get("code")); System.out.println(res.get("data")); } }

  

  2.在内网执行时,会报sslHandshakeException

   3.token没有解密方法

 

不搞上面的

 

转载于:https://www.cnblogs.com/zhizhiyin/p/9436644.html

最后

以上就是柔弱枕头最近收集整理的关于工作计划:近期工作实用安排的全部内容,更多相关工作计划内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(70)

评论列表共有 0 条评论

立即
投稿
返回
顶部