没有合适的资源?快使用搜索试试~ 我知道了~
401鉴权请求代码
需积分: 50 1 下载量 182 浏览量
2019-02-19
17:07:37
上传
评论 1
收藏 3KB TXT 举报
温馨提示
试读
3页
做项目中遇到的HTTP Digest鉴权认证,网上查资料写出来的代码,有需要的伙伴可以看看。
资源推荐
资源详情
资源评论
package com.ctsing.emsm.module.cmcc.qlyapi;
import java.io.IOException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import org.apache.http.Header;
import org.apache.http.HttpEntity;
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.HttpClients;
import org.apache.http.util.EntityUtils;
import com.ctsing.emsm.module.cmcc.util.Util;
import net.sf.json.JSONObject;
public class BaseAPI extends Util{
JSONObject responseResult;
public JSONObject getResponseInTypeOfPost(String url,JSONObject param){
CloseableHttpClient client = HttpClients.createDefault();
try {
//第一次请求
import java.io.IOException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import org.apache.http.Header;
import org.apache.http.HttpEntity;
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.HttpClients;
import org.apache.http.util.EntityUtils;
import com.ctsing.emsm.module.cmcc.util.Util;
import net.sf.json.JSONObject;
public class BaseAPI extends Util{
JSONObject responseResult;
public JSONObject getResponseInTypeOfPost(String url,JSONObject param){
CloseableHttpClient client = HttpClients.createDefault();
try {
//第一次请求
资源评论
灵动领域
- 粉丝: 1
- 资源: 16
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- tensorflow-rocm-2.12.0.560-cp311-cp311-manylinux2014-x86-64.whl
- Windows操作系统中的CMD(命令提示符).md
- tensorflow-rocm-2.12.0.560-cp39-cp39-manylinux2014-x86-64.whl
- mmexport1713512496118.jpg
- 基于VB的俄罗斯方块系统设计与实现(源代码+参考文献).zip
- 软件测试开发工具大全资源包之Linux虚拟机
- python毕设-图片批量处理器
- 基于VB的教材管理系统设计(源代码+系统+报告+PPT).zip
- Lock接口与synchronized关键字
- 基于Java的图书馆自习室座位预约系统设计源码
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功