本文整理了Java中elemental2.dom.XMLHttpRequest.send()
方法的一些代码示例,展示了XMLHttpRequest.send()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLHttpRequest.send()
方法的具体详情如下:
包路径:elemental2.dom.XMLHttpRequest
类名称:XMLHttpRequest
方法名:send
暂无
代码示例来源:origin: com.google.elemental2/elemental2-dom
@JsOverlay
public final void send(String data) {
send(Js.<XMLHttpRequest.SendDataUnionType>uncheckedCast(data));
}
代码示例来源:origin: com.google.elemental2/elemental2-dom
@JsOverlay
public final void send(ArrayBufferView data) {
send(Js.<XMLHttpRequest.SendDataUnionType>uncheckedCast(data));
}
代码示例来源:origin: com.google.elemental2/elemental2-dom
@JsOverlay
public final void send(Document data) {
send(Js.<XMLHttpRequest.SendDataUnionType>uncheckedCast(data));
}
代码示例来源:origin: org.realityforge.com.google.elemental2/elemental2-dom
@JsOverlay
public final void send(String data) {
send(Js.<XMLHttpRequest.SendDataUnionType>uncheckedCast(data));
}
代码示例来源:origin: com.google.elemental2/elemental2-dom
@JsOverlay
public final void send(ArrayBuffer data) {
send(Js.<XMLHttpRequest.SendDataUnionType>uncheckedCast(data));
}
代码示例来源:origin: com.google.elemental2/elemental2-dom
@JsOverlay
public final void send(Blob data) {
send(Js.<XMLHttpRequest.SendDataUnionType>uncheckedCast(data));
}
代码示例来源:origin: org.realityforge.com.google.elemental2/elemental2-dom
@JsOverlay
public final void send(ArrayBuffer data) {
send(Js.<XMLHttpRequest.SendDataUnionType>uncheckedCast(data));
}
代码示例来源:origin: org.realityforge.com.google.elemental2/elemental2-dom
@JsOverlay
public final void send(ArrayBufferView data) {
send(Js.<XMLHttpRequest.SendDataUnionType>uncheckedCast(data));
}
代码示例来源:origin: org.realityforge.com.google.elemental2/elemental2-dom
@JsOverlay
public final void send(Blob data) {
send(Js.<XMLHttpRequest.SendDataUnionType>uncheckedCast(data));
}
代码示例来源:origin: org.realityforge.com.google.elemental2/elemental2-dom
@JsOverlay
public final void send(Document data) {
send(Js.<XMLHttpRequest.SendDataUnionType>uncheckedCast(data));
}
代码示例来源:origin: com.google.elemental2/elemental2-dom
public native void send(XMLHttpRequest.SendDataUnionType data);
代码示例来源:origin: org.realityforge.com.google.elemental2/elemental2-dom
public native void send(XMLHttpRequest.SendDataUnionType data);
代码示例来源:origin: intendia-oss/autorest
FormData form = new FormData();
formParams.forEach(p -> form.append(p.k, Objects.toString(p.v)));
xhr.send(form);
} else {
if (!headers.containsKey(CONTENT_TYPE)) xhr.setRequestHeader(CONTENT_TYPE, APPLICATION_JSON);
if (!headers.containsKey(ACCEPT)) xhr.setRequestHeader(ACCEPT, APPLICATION_JSON);
if (data != null) xhr.send(Global.JSON.stringify(data));
else xhr.send();
代码示例来源:origin: org.jboss.hal/hal-dmr
private Single<ModelNode> uploadFormData(FormData formData, Operation operation) {
return Single.fromEmitter(emitter -> {
XMLHttpRequest xhr = newDmrXhr(endpoints.upload(), POST, operation, new UploadPayloadProcessor(),
emitter::onSuccess,
(op, fail) -> emitter.onError(new DispatchFailure(fail, operation)),
(op, error) -> emitter.onError(error));
xhr.send(formData);
// Uploads are not supported in macros!
});
}
代码示例来源:origin: org.jboss.hal/hal-dmr
@JsIgnore
public void download(Operation operation, Consumer<String> success) {
Operation downloadOperation = runAs(operation);
String url = downloadUrl(downloadOperation);
XMLHttpRequest request = newXhr(url, GET, downloadOperation, exceptionCallback, xhr -> {
int status = (int) xhr.status;
String responseText = xhr.responseText;
if (status == 200) {
success.accept(responseText);
} else {
handleErrorCodes(url, status, downloadOperation, exceptionCallback);
}
});
request.setRequestHeader(ACCEPT.header(), APPLICATION_DMR_ENCODED);
request.setRequestHeader(CONTENT_TYPE.header(), APPLICATION_DMR_ENCODED);
request.send();
// Downloads are not supported in macros!
}
代码示例来源:origin: org.jboss.hal/hal-dmr
private Single<ModelNode> dmr(Operation operation) {
Operation dmrOperation = runAs(operation); // runAs might mutate the operation, so do it synchronously
boolean get = GetOperation.isSupported(dmrOperation.getName());
String url = get ? operationUrl(dmrOperation) : endpoints.dmr();
HttpMethod method = get ? GET : POST;
// ^-- those eager fields are useful if we don't want to evaluate it on each Single subscription
return Single.fromEmitter(emitter -> {
// in general, code inside the RX type should be able to be executed multiple times and always returns
// the same result, so we need to be careful to not mutate anything (like the operation). This is useful
// for example if we want to use the retry operator which will try again (subscribe again) if it fails.
XMLHttpRequest xhr = newDmrXhr(url, method, dmrOperation, new DmrPayloadProcessor(), emitter::onSuccess,
(op, fail) -> emitter.onError(new DispatchFailure(fail, operation)),
(op, error) -> emitter.onError(error));
xhr.setRequestHeader(ACCEPT.header(), APPLICATION_DMR_ENCODED);
xhr.setRequestHeader(CONTENT_TYPE.header(), APPLICATION_DMR_ENCODED);
if (get) {
xhr.send();
} else {
xhr.send(dmrOperation.toBase64String());
}
recordOperation(operation);
});
}
代码示例来源:origin: org.jresearch.dominokit/domino-ui
formData.append(file.name, file);
beforeUploadHandlers.forEach(handler -> handler.onBeforeUpload(request));
request.send(formData);
代码示例来源:origin: DominoKit/domino-ui
formData.append(file.name, file);
beforeUploadHandlers.forEach(handler -> handler.onBeforeUpload(request));
request.send(formData);
内容来源于网络,如有侵权,请联系作者删除!