postman导出请求url_Postman导出Api文档

该博客介绍了一个Java工具类`ExportPostManApiUtil`,用于读取Postman导出的JSON数据,并将其解析为接口名称、地址、请求方式及请求参数等信息,最终将这些信息拼接成HTML格式,方便查看和管理API文档。
摘要由CSDN通过智能技术生成

packagezf;importnet.sf.json.JSONArray;importnet.sf.json.JSONObject;import java.io.*;importjava.util.ArrayList;importjava.util.List;/*** Created by Yan on 2018/4/3.*/

public classExportPostManApiUtil {public staticString readToString(String fileName) {

String encoding= "UTF-8";

File file= newFile(fileName);

Long fileLength=file.length();byte[] fileContent = new byte[fileLength.intValue()];try{

FileInputStream in= newFileInputStream(file);

in.read(fileContent);

in.close();

}catch(FileNotFoundException e) {

e.printStackTrace();

}catch(IOException e) {

e.printStackTrace();

}try{return newString(fileContent, encoding);

}catch(UnsupportedEncodingException e) {

System.err.println("The OS does not support " +encoding);

e.printStackTrace();return nu

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值