本文整理汇总了Java中com.google.gwt.http.client.RequestBuilder.Method类的典型用法代码示例。如果您正苦于以下问题:Java Method类的具体用法?Java Method怎么用?Java Method使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Method类属于com.google.gwt.http.client.RequestBuilder包,在下文中一共展示了Method类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import com.google.gwt.http.client.RequestBuilder.Method; //导入依赖的package包/类
@Before
public void init() throws Exception {
MockI18n.mock(ServerIneFormI18nProvider.class);
MockitoAnnotations.initMocks(this);
descriptorStore = TestUtil.descriptorStore;
testKvo = (KeyValueObject) TestUtil.getTestKvo().getAssistedObject();
when(requestBuilderFactory.createBuilder(any(Method.class), anyString()))
.thenReturn(requestBuilder);
restDataConnector = new RestDataConnector(
Mockito.mock(EventBus.class),
Mockito.mock(AsyncStatusIndicator.class),
requestBuilderFactory,
descriptorStore,
new AssistedObjectHandlerFactory(descriptorStore),
"testKvo",
"getUrl",
"newUrl",
"modifyUrl",
"deleteUrl",
false);
}
示例2: AsyncRequest
import com.google.gwt.http.client.RequestBuilder.Method; //导入依赖的package包/类
/**
* Create new {@link AsyncRequest} instance.
*
* @param method request method
* @param url request URL
* @param async if {@code true} - request will be send in asynchronous mode (as asynchronous
* EverRest task).<br>
* See <a href="https://github.com/codenvy/everrest/wiki/Asynchronous-Requests">EverRest
* Asynchronous requests</a> for details.
*/
protected AsyncRequest(Method method, String url, boolean async) {
if (async) {
if (url.contains("?")) {
url += "&async=true";
} else {
url += "?async=true";
}
}
this.requestBuilder = new RequestBuilder(method, url);
this.async = async;
this.checkAsyncTaskStatusTimer = new CheckEverRestTaskStatusTimer();
this.asyncRequestCallback = new EverRestAsyncRequestCallback();
}
示例3: send
import com.google.gwt.http.client.RequestBuilder.Method; //导入依赖的package包/类
private <T extends JavaScriptObject> void send(Method method, HttpCallback<T> cb) {
HttpImpl<T> httpCallback = new HttpImpl<>(background, cb);
try {
if (!background) {
RpcStatus.INSTANCE.onRpcStart();
}
request(method).sendRequest(null, httpCallback);
} catch (RequestException e) {
httpCallback.onError(null, e);
}
}
示例4: sendJSON
import com.google.gwt.http.client.RequestBuilder.Method; //导入依赖的package包/类
private <T extends JavaScriptObject> void sendJSON(
Method method, JavaScriptObject content, HttpCallback<T> cb) {
HttpImpl<T> httpCallback = new HttpImpl<>(background, cb);
try {
if (!background) {
RpcStatus.INSTANCE.onRpcStart();
}
RequestBuilder req = request(method);
req.setHeader("Content-Type", JSON_UTF8);
req.sendRequest(str(content), httpCallback);
} catch (RequestException e) {
httpCallback.onError(null, e);
}
}
示例5: sendText
import com.google.gwt.http.client.RequestBuilder.Method; //导入依赖的package包/类
private <T extends JavaScriptObject> void sendText(
Method method, String body, HttpCallback<T> cb) {
HttpImpl<T> httpCallback = new HttpImpl<>(background, cb);
try {
if (!background) {
RpcStatus.INSTANCE.onRpcStart();
}
RequestBuilder req = request(method);
req.setHeader("Content-Type", TEXT_UTF8);
req.sendRequest(body, httpCallback);
} catch (RequestException e) {
httpCallback.onError(null, e);
}
}
示例6: request
import com.google.gwt.http.client.RequestBuilder.Method; //导入依赖的package包/类
private RequestBuilder request(Method method) {
RequestBuilder req = new RequestBuilder(method, url());
if (ifNoneMatch != null) {
req.setHeader("If-None-Match", ifNoneMatch);
}
req.setHeader("Accept", JSON_TYPE);
if (Gerrit.getXGerritAuth() != null) {
req.setHeader(HostPageData.XSRF_HEADER_NAME, Gerrit.getXGerritAuth());
}
return req;
}
示例7: sendRequest
import com.google.gwt.http.client.RequestBuilder.Method; //导入依赖的package包/类
private void sendRequest(final RequestCallback callback, final Method method, final String url) {
final RequestBuilder builder = new RequestBuilder(method, url);
builder.setHeader("accept", "application/json");
try {
builder.sendRequest(null, callback);
} catch (final RequestException e) {
e.printStackTrace();
}
}
示例8: createBuilder
import com.google.gwt.http.client.RequestBuilder.Method; //导入依赖的package包/类
@Override
public RequestBuilder createBuilder(Method method, String url) {
return new RequestBuilder(method, url);
}
示例9: newRequest
import com.google.gwt.http.client.RequestBuilder.Method; //导入依赖的package包/类
protected RequestBuilder newRequest(final Method method, final String url) {
return new RequestBuilder(method, url);
}
示例10: ServletRequestBuilder
import com.google.gwt.http.client.RequestBuilder.Method; //导入依赖的package包/类
/**
* Builds a new {@code ServletRequestBuilder} with the given parameters.
*
* @param injector
* The client-side injector.
* @param requestMethod
* request method.
* @param servlet
* The servlet.
* @param method
* The servlet method to execute.
*/
public ServletRequestBuilder(final Injector injector, final Method requestMethod, final Servlet servlet, final ServletMethod method) {
this.requestMethod = requestMethod;
this.urlBuilder = new ServletUrlBuilder(injector.getAuthenticationProvider(), injector.getPageManager(), servlet, method);
this.requestAttributes = new HashMap<String, String>();
this.urlBuilder.addParameter(ServletConstants.AJAX, ClientUtils.toList(true));
}
示例11: createBuilder
import com.google.gwt.http.client.RequestBuilder.Method; //导入依赖的package包/类
public RequestBuilder createBuilder(Method method, String url);
示例12: create
import com.google.gwt.http.client.RequestBuilder.Method; //导入依赖的package包/类
RequestBuilder create(Method method, String url);