本文整理了Java中org.eclipse.jetty.client.api.Request.agent
方法的一些代码示例,展示了Request.agent
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.agent
方法的具体详情如下:
包路径:org.eclipse.jetty.client.api.Request
类名称:Request
方法名:agent
暂无
代码示例来源:origin: labsai/EDDI
@Override
public IRequest setUserAgent(String userAgent) {
request.agent(userAgent);
return this;
}
代码示例来源:origin: NationalSecurityAgency/lemongrenade
/**
* Deletes the entire graph from the LemonGraph database.
*
* @param graphId String of graph ID
* @return JSONObject
* @throws InvalidGraphException thrown when failing to hit LemonGraph graph/
*/
public static JSONObject deleteGraph(String graphId) throws InvalidGraphException {
JSONObject ret = new JSONObject();
try {
openConnection();
ContentResponse res = client.newRequest(restUrl+"graph/"+graphId)
.method(HttpMethod.DELETE)
.agent("Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:17.0) Gecko/20100101 Firefox/17.0")
.send();
int status = res.getStatus();
ret.put("status", status);
ret.put("message", res.getContentAsString());
return ret;
}
catch (Exception e) {
log.error("Caught exception in deleteGraph "+e.getMessage());
throw new InvalidGraphException(e.getMessage());
}
}
代码示例来源:origin: org.apache.kafka/connect-runtime
req.method(method);
req.accept("application/json");
req.agent("kafka-connect");
if (serializedBody != null) {
req.content(new StringContentProvider(serializedBody, StandardCharsets.UTF_8), "application/json");
内容来源于网络,如有侵权,请联系作者删除!