com.squareup.okhttp.Request.toString()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(4.7k)|赞(0)|评价(0)|浏览(159)

本文整理了Java中com.squareup.okhttp.Request.toString方法的一些代码示例,展示了Request.toString的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.toString方法的具体详情如下:
包路径:com.squareup.okhttp.Request
类名称:Request
方法名:toString

Request.toString介绍

暂无

代码示例

代码示例来源:origin: Coinomi/coinomi-android

@Override
      public void onFailure(Request request, IOException e) {
        log.info("Failed to communicate with server:  " + request.toString());
        // FIXME infinite recursion
//                getTransaction(txHash, listener);
      }

代码示例来源:origin: openwalletGH/openwallet-android

@Override
      public void onFailure(Request request, IOException e) {
        log.info("Failed to communicate with server:  " + request.toString());
        // FIXME infinite recursion
//                getTransaction(txHash, listener);
      }

代码示例来源:origin: Coinomi/coinomi-android

@Override
public void onFailure(Request request, IOException e) {
  log.info("Failed to communicate with server:  " + request.toString());
}

代码示例来源:origin: openwalletGH/openwallet-android

@Override
public void onFailure(Request request, IOException e) {
  log.info("Failed to communicate with server:  " + request.toString());
}

代码示例来源:origin: Coinomi/coinomi-android

@Override
public void onFailure(Request request, IOException e) {
  log.info("Failed to communicate with server:  " + request.toString());
  getTransactionBytes(txId, listener, confirmations);
}

代码示例来源:origin: openwalletGH/openwallet-android

@Override
public void onFailure(Request request, IOException e) {
  log.info("Failed to communicate with server:  " + request.toString());
  getTransactionBytes(txId, listener, confirmations);
}

代码示例来源:origin: cyforever123/ElectronicbrandProject

@Override
public void onFailure(Request request, IOException e) {
  EBLog.e(TAG, request.toString() + e.toString());
  if (!isHaveActivtyName(activityName)) return;
  notifyMsg = NETWORK_ERROR;
  postErrorMsg();
}

代码示例来源:origin: NightscoutFoundation/xDrip

.header("Accept", "application/json")
    .build();
Log.d(TAG, "Sending request: " + modifiedRequest.toString());
Buffer buffer = new Buffer();
copy.body().writeTo(buffer);

代码示例来源:origin: jamorham/xDrip-plus

.header("Accept", "application/json")
    .build();
Log.d(TAG, "Sending request: " + modifiedRequest.toString());
Buffer buffer = new Buffer();
copy.body().writeTo(buffer);

代码示例来源:origin: Leaking/WeGit

@Override
  public com.squareup.okhttp.Response intercept(Chain chain) throws IOException {
    L.i(TAG,"------getRetrofitWithoutTokenInstance intercept start-------");
    Request request = chain.request();
    request = request.newBuilder()
        .removeHeader("User-Agent")
        .addHeader("User-Agent", "Leaking/1.0")
         //.addHeader("Accept", "application/vnd.github.beta+json")
        .addHeader("Accept", "application/vnd.github.v3.raw")
        .build();
    //此处build之后要返回request覆盖
    L.i(TAG, "Interceptor header = " + request.headers());
    L.i(TAG, "Interceptor request = " + request.toString());
    L.i(TAG,"------getRetrofitWithoutTokenInstance intercept end-------");
    return chain.proceed(request);
  }
});

代码示例来源:origin: Leaking/WeGit

@Override
  public com.squareup.okhttp.Response intercept(Chain chain) throws IOException {
    L.i(TAG,"------getStringRetrofitInstance intercept start-------");
    Request request = chain.request();
    GitHubAccount gitHubAccount = GitHubAccount.getInstance(context);
    token = gitHubAccount.getAuthToken();
    //此处build之后要返回request覆盖
    request = request.newBuilder()
        .addHeader("Authorization", "Token " + token)
        .addHeader("User-Agent", "Leaking/1.0")
            //.addHeader("Accept", "application/vnd.github.beta+json")
        .addHeader("Accept", "application/vnd.github.v3.raw")
        .build();
    // L.i(TAG, "Interceptor header = " + request.headers());
    L.i(TAG, "Interceptor token = " + token);
    L.i(TAG, "Interceptor request = " + request.toString());
    L.i(TAG,"------getStringRetrofitInstance intercept end-------");
    return chain.proceed(request);
  }
});

代码示例来源:origin: Leaking/WeGit

@Override
  public com.squareup.okhttp.Response intercept(Chain chain) throws IOException {
    L.i(TAG,"------getJsonRetrofitInstance intercept start-------");
    Request request = chain.request();
    GitHubAccount gitHubAccount = GitHubAccount.getInstance(context);
    token = gitHubAccount.getAuthToken();
    request = request.newBuilder()
        .removeHeader("User-Agent")
        .addHeader("Authorization", "Token " + token)
        .addHeader("User-Agent", "Leaking/1.0")
        //.addHeader("Accept", "application/vnd.github.beta+json")
        .addHeader("Accept", "application/vnd.github.v3.raw")
            .build();
    L.i(TAG, "Interceptor token = " + token);
    L.i(TAG, "Interceptor request = " + request.toString());
    L.i(TAG,"------getJsonRetrofitInstance intercept end-------");
    return chain.proceed(request);
  }
});

相关文章