java - 使用密钥保护 OkHttp
问题描述
我有这个代码:
JSONParser jsonParser1 = new JSONParser();
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("url")
.build();
Call call = client.newCall(request);
call.enqueue(new okhttp3.Callback() {
@Override
public void onFailure(Call call, IOException e) {
//observe reason of failure using
e.printStackTrace();
}
@Override
public void onResponse(Call call, Response response) throws IOException {
if(response.isSuccessful()){
}
}
目前代码使用它从“url”调用json信息。
我想更改代码,以便它通过 url 传递一个键,如果该键与 PHP 中检查的键匹配,它会返回数据。
解决方案
推荐阅读
- javascript - 有没有办法将所有控制台输出记录到 HTML 页面?
- python - Python3递归调用函数,递归调用函数时缩进每个新调用和意外输出
- azure - Power BI DirectQuery 数据不会加载
- python - 如何将父模型字段与django中的当前模型字段相乘?
- php - php 有时会在发布表单后回显 file_get_contents('php://input')
- magento2 - Magento 2 - 电子邮件重置密码链接不起作用
- javascript - 模拟空中客车 ECAM 显示数字量具
- android - android : 通过数据库搜索具有多个微调器的 Listview
- amazon-web-services - 将多个 S3 文件聚合到一个文件中
- c# - 当用户已经登录网站'A'时如何自动登录网站'B'