本文整理了Java中org.eclipse.jetty.server.Request.<init>
方法的一些代码示例,展示了Request.<init>
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.<init>
方法的具体详情如下:
包路径:org.eclipse.jetty.server.Request
类名称:Request
方法名:<init>
暂无
代码示例来源:origin: stackoverflow.com
// Have one (or more) threads ready to do the async tasks. Do this during startup of your app.
ExecutorService executor = Executors.newFixedThreadPool(1);
// Fire a request.
Future<Response> response = executor.submit(new Request(new URL("http://google.com")));
// Do your other tasks here (will be processed immediately, current thread won't block).
// ...
// Get the response (here the current thread will block until response is returned).
InputStream body = response.get().getBody();
// ...
// Shutdown the threads during shutdown of your app.
executor.shutdown();
代码示例来源:origin: xuxueli/xxl-job
public static void invokeAdminService(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
jettyServerHandler.handle(null, new Request(null, null), request, response);
}
代码示例来源:origin: stackoverflow.com
// could be any class that implements Map
Map<String, String> mHeaders = new ArrayMap<String, String>();
mHeaders.put("user", USER);
mHeaders.put("pass", PASSWORD);
Request req = new Request(url, postBody, listener, errorListener) {
public Map<String, String> getHeaders() {
return mHeaders;
}
}
代码示例来源:origin: neo4j/neo4j
private static Request newRequest()
{
HttpChannel channel = mock( HttpChannel.class );
Response response = new Response( channel, mock( HttpOutput.class ) );
Request request = new Request( channel, mock( HttpInput.class ) );
when( channel.getRequest() ).thenReturn( request );
when( channel.getResponse() ).thenReturn( response );
return request;
}
代码示例来源:origin: stackoverflow.com
foo.bar = function() {
var callback = gate(this.method, 2);
sendAjax(new Request(), callback);
sendAjax(new Request(), callback);
}
代码示例来源:origin: stackoverflow.com
foo.bar = function() {
var me = this;
var callback = gate(function(a,b,c) { me.method(a,b,c); }, 2);
sendAjax(new Request(), callback);
sendAjax(new Request(), callback);
}
代码示例来源:origin: stackoverflow.com
foo.bar = function() {
var callback = gate(bind_context(this, this.method), 2);
sendAjax(new Request(), callback);
sendAjax(new Request(), callback);
}
代码示例来源:origin: stackoverflow.com
public void callWebService() {
SampleService srv1 = new SampleService();
Request req = new Request();
req.companyId = "1";
req.userName = "userName";
req.password = "pas";
Response response = srv1.ServiceSample(req);
}
代码示例来源:origin: stackoverflow.com
var foo = new Request({
url: 'http://fragged.org/Epitome/example/data/',
method: 'get',
onComplete: function (data) {
// returns an object with name and surname
new Element('div[html="{name} {surname}"]'.substitute(JSON.decode(data))).inject(document.body);
}
});
// need to remove that or CORS will need to match it specifically
delete foo.headers['X-Requested-With'];
foo.send();
代码示例来源:origin: stackoverflow.com
new Request({
url: 'hanteraTaBortAnvandare.php',
method: 'post',
data: {
'id': '10'
},
onComplete: function(response) {
alert(response);
}
});
代码示例来源:origin: stackoverflow.com
var myRequest = new Request({
url: "something.php",
evalScripts: true,
onSuccess: function(responseText, responseXML){
....
}
});
myRequest.send();
代码示例来源:origin: stackoverflow.com
public RequestBuilder {
// setters and getters for all properties
public Request build() {
doStuff();
Request request = new Request(this);
doAfterStuff();
return request;
}
}
代码示例来源:origin: stackoverflow.com
var req = new Request({link: "chain"});
req.send();
// this won't run until the previous request has completed:
req.send();
// this will run independently of the above and may finish first as
// they are not synchronous and this is a brand new instance.
new Request().send();
代码示例来源:origin: stackoverflow.com
var request = new Request({
url: 'form.php',
method: 'post',
data: {
userId:1111,
test: 'test'
},
onSuccess: function(response){ Whatever you want to do}
}
request.send();
代码示例来源:origin: stackoverflow.com
public class Client {
public Status get(String request) {
return get(new Request(request));
}
public Status get(Request request) {
// do stuff
}
}
代码示例来源:origin: stackoverflow.com
Map<String, String> mHeaders = new ArrayMap<String, String>();
mHeaders.put("StringType", Stringg);
mHeaders.put("IntType", integerr);
Request req = new Request(url, postBody, listener, errorListener) {
public Map<String, String> getHeaders() {
return mHeaders;
}
}
代码示例来源:origin: stackoverflow.com
public void callWebService(){
SampleService srv1 = new SampleService();
Request req = new Request();
req.companyId = "1";
req.userName = "userName";
req.password = "pas";
Response response = srv1.ServiceSample(req);
}
代码示例来源:origin: stackoverflow.com
SampleService srv1 = new SampleService();
req = new Request();
req.companyId = "1";
req.userName = "userName";
req.password = "pas";
Response response = srv1.ServiceSample(req);
代码示例来源:origin: stackoverflow.com
Client client = new Client(Protocol.HTTP);
Request r = new Request();
r.setResourceRef("http://127.0.0.1:8182/sample");
r.setMethod(Method.GET);
r.getClientInfo().getAcceptedMediaTypes().add(new Preference<MediaType>(MediaType.TEXT_XML));
client.handle(r).getEntity().write(System.out);
代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9
public HttpChannel(Connector connector, HttpConfiguration configuration, EndPoint endPoint, HttpTransport transport, HttpInput<T> input)
{
_connector = connector;
_configuration = configuration;
_endPoint = endPoint;
_transport = transport;
_uri = new HttpURI(URIUtil.__CHARSET);
_state = new HttpChannelState(this);
_request = new Request(this, input);
_response = new Response(this, new HttpOutput(this));
}
内容来源于网络,如有侵权,请联系作者删除!