本文整理了Java中com.mashape.unirest.request.HttpRequest.headers()
方法的一些代码示例,展示了HttpRequest.headers()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HttpRequest.headers()
方法的具体详情如下:
包路径:com.mashape.unirest.request.HttpRequest
类名称:HttpRequest
方法名:headers
暂无
代码示例来源:origin: Kong/unirest-java
@Override
public HttpRequestWithBody headers(Map<String, String> headers) {
return (HttpRequestWithBody) super.headers(headers);
}
代码示例来源:origin: Kong/unirest-java
@Override
public GetRequest headers(Map<String, String> headers) {
return (GetRequest) super.headers(headers);
}
代码示例来源:origin: com.mashape.unirest/unirest-java
@Override
public GetRequest headers(Map<String, String> headers) {
return (GetRequest) super.headers(headers);
}
代码示例来源:origin: com.mashape.unirest/unirest-java
@Override
public HttpRequestWithBody headers(Map<String, String> headers) {
return (HttpRequestWithBody) super.headers(headers);
}
代码示例来源:origin: com.github.bingoohuang/unirest-java
@Override
public GetRequest headers(Map<String, String> headers) {
return (GetRequest) super.headers(headers);
}
代码示例来源:origin: com.github.bingoohuang/unirest-java
@Override
public HttpRequestWithBody headers(Map<String, String> headers) {
return (HttpRequestWithBody) super.headers(headers);
}
代码示例来源:origin: CognitiveJ/cognitivej
private T doWork() {
try {
setupErrorHandlers();
WorkingContext workingContext = workingContext();
HttpRequest builtRequest = buildUnirest(workingContext)
.queryString(workingContext.getQueryParams())
.headers(workingContext.getHeaders()).header("Ocp-Apim-Subscription-Key", cognitiveContext.subscriptionKey);
if (!workingContext.getHttpMethod().equals(HttpMethod.GET) && workingContext().getPayload().size() > 0) {
buildBody((HttpRequestWithBody) builtRequest);
}
HttpResponse response;
if (typedResponse() == InputStream.class)
response = builtRequest.asBinary();
else
response = builtRequest.asString();
checkForError(response);
return postProcess(typeResponse(response.getBody()));
} catch (UnirestException | IOException e) {
throw new CognitiveException(e);
}
}
内容来源于网络,如有侵权,请联系作者删除!