java.lang.Object
org.htmlunit.corejs.javascript.SlotMapOwner<org.htmlunit.corejs.javascript.Scriptable>
org.htmlunit.corejs.javascript.ScriptableObject
org.htmlunit.javascript.HtmlUnitScriptable
org.htmlunit.javascript.host.fetch.Request
- All Implemented Interfaces:
Serializable,Cloneable,org.htmlunit.corejs.javascript.ConstProperties<org.htmlunit.corejs.javascript.Scriptable>,org.htmlunit.corejs.javascript.debug.DebuggableObject,org.htmlunit.corejs.javascript.PropHolder<org.htmlunit.corejs.javascript.Scriptable>,org.htmlunit.corejs.javascript.Scriptable,org.htmlunit.corejs.javascript.SymbolScriptable
A JavaScript object for
Request.- Author:
- Ahmed Ashour, Ronald Brill
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.htmlunit.corejs.javascript.ScriptableObject
org.htmlunit.corejs.javascript.ScriptableObject.DescriptorInfo, org.htmlunit.corejs.javascript.ScriptableObject.KeyComparator, org.htmlunit.corejs.javascript.ScriptableObject.LambdaGetterFunction, org.htmlunit.corejs.javascript.ScriptableObject.LambdaSetterFunction -
Field Summary
Fields inherited from class org.htmlunit.corejs.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, LEGACY_CONST, PERMANENT, READONLY, STRICTLY_READONLY, UNINITIALIZED_CONSTFields inherited from class org.htmlunit.corejs.javascript.SlotMapOwner
isSealedFields inherited from interface org.htmlunit.corejs.javascript.Scriptable
NOT_FOUND -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.htmlunit.corejs.javascript.NativePromiseReturns a promise for the body as ArrayBuffer.org.htmlunit.corejs.javascript.NativePromiseblob()Returns a promise for the body as Blob.org.htmlunit.corejs.javascript.NativePromisebytes()Returns a promise for the body as Uint8Array.org.htmlunit.corejs.javascript.NativePromiseformData()Returns a promise for the body as FormData.getBody()Returns the body asReadableStream.getCache()Returns the cache mode.Returns the credentials mode.Returns the destination; always empty for requests created by script.Returns the duplex mode; always 'half'.Returns the headers.Returns the integrity metadata.Returns the method.getMode()Returns the mode.Returns the redirect mode.Returns the referrer: 'about:client', an empty string (no referrer) or the url.Returns the referrer policy.Returns the signal.getUrl()Returns the url.booleanReturns whether the body was used.booleanReturns whether this is a history navigation request; always false.booleanReturns whether this is a reload navigation request; always false.booleanReturns the keepalive flag.jsClone()Returns a copy of this request.static RequestjsConstructor(org.htmlunit.corejs.javascript.Context cx, org.htmlunit.corejs.javascript.VarScope scope, Object[] args, org.htmlunit.corejs.javascript.Function ctorObj, boolean inNewExpr) JavaScript constructor.org.htmlunit.corejs.javascript.NativePromisejson()Returns a promise for the body parsed as JSON.org.htmlunit.corejs.javascript.NativePromisetext()Returns a promise for the body as text.Methods inherited from class org.htmlunit.javascript.HtmlUnitScriptable
clone, createDOMException, equivalentValues, get, getBrowserVersion, getClassName, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getIds, getIndexedPropertyCount, getOwnPropertyDescriptor, getPrototype, getScriptableFor, getWindow, getWindow, getWindowOrWorkerGlobalScope, getWithPreemption, has, hasInstance, isIndexedPropertyWritable, makeScriptableFor, put, setClassName, setDomNode, setDomNode, setupPromise, setupRejectedPromiseMethods inherited from class org.htmlunit.corejs.javascript.ScriptableObject
applyDescriptorToAttributeBitset, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkNotSealed, checkPropertyChangeForSlot, checkPropertyChangeForSlot, checkPropertyDefinition, checkPropertyDefinition, checkSlotRemoval, defineBuiltinProperty, defineBuiltinProperty, defineBuiltInProperty, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, delete, deleteProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureScriptableObjectButNotSymbol, ensureSymbolScriptable, ensureType, get, get, getAllIds, getAncestor, getArrayPrototype, getClassPrototype, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getObjectPrototype, getParentScope, getProperty, getProperty, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getSuperProperty, getSuperProperty, getSuperProperty, getThis, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, hasProperty, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGenericDescriptor, isGetterOrSetter, isGetterOrSetter, isTrue, preventExtensions, put, put, putConst, putConstProperty, putConstProperty, putOwnProperty, putOwnProperty, putOwnProperty, putProperty, putProperty, putProperty, putProperty, putSuperProperty, putSuperProperty, putSuperProperty, querySlot, redefineProperty, redefineProperty, sameValue, sealObject, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setParentScope, setPrototype, sizeMethods inherited from class org.htmlunit.corejs.javascript.SlotMapOwner
associateValue, checkNotSealed, copyAssociatedValue, createSlotMap, createSlotMap, defineProperty, defineProperty, get, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getIds, has, has, isSealed, readMaps, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, writeMapsMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.htmlunit.corejs.javascript.Scriptable
get, getIds, has, hasMethods inherited from interface org.htmlunit.corejs.javascript.SymbolScriptable
get, has
-
Constructor Details
-
Request
public Request()Default constructor.
-
-
Method Details
-
jsConstructor
public static Request jsConstructor(org.htmlunit.corejs.javascript.Context cx, org.htmlunit.corejs.javascript.VarScope scope, Object[] args, org.htmlunit.corejs.javascript.Function ctorObj, boolean inNewExpr) JavaScript constructor.- Parameters:
cx- the current contextscope- the scopeargs- the arguments (the input - a url or aRequest- and the optional init)ctorObj- the function objectinNewExpr- whether invoked vianew- Returns:
- the new
Requestinstance - See Also:
-
jsClone
Returns a copy of this request.- Returns:
- the copy
-
getMethod
Returns the method.- Returns:
- the method
-
getUrl
Returns the url.- Returns:
- the url
-
getHeaders
Returns the headers.- Returns:
- the headers
-
getDestination
Returns the destination; always empty for requests created by script.- Returns:
- the destination
-
getReferrer
Returns the referrer: 'about:client', an empty string (no referrer) or the url.- Returns:
- the referrer
-
getReferrerPolicy
Returns the referrer policy.- Returns:
- the referrer policy
-
getMode
Returns the mode.- Returns:
- the mode
-
getCredentials
Returns the credentials mode.- Returns:
- the credentials mode
-
getCache
Returns the cache mode.- Returns:
- the cache mode
-
getRedirect
Returns the redirect mode.- Returns:
- the redirect mode
-
getIntegrity
Returns the integrity metadata.- Returns:
- the integrity metadata
-
isKeepalive
public boolean isKeepalive()Returns the keepalive flag.- Returns:
- the keepalive flag
-
getSignal
Returns the signal.- Returns:
- the signal
-
getDuplex
Returns the duplex mode; always 'half'.- Returns:
- the duplex mode
-
getBody
Returns the body asReadableStream.- Returns:
- the stream or
nullif there is no body
-
isBodyUsed
public boolean isBodyUsed()Returns whether the body was used.- Returns:
- whether the body was used
-
text
public org.htmlunit.corejs.javascript.NativePromise text()Returns a promise for the body as text.- Returns:
- the promise
-
json
public org.htmlunit.corejs.javascript.NativePromise json()Returns a promise for the body parsed as JSON.- Returns:
- the promise
-
arrayBuffer
public org.htmlunit.corejs.javascript.NativePromise arrayBuffer()Returns a promise for the body as ArrayBuffer.- Returns:
- the promise
-
bytes
public org.htmlunit.corejs.javascript.NativePromise bytes()Returns a promise for the body as Uint8Array.- Returns:
- the promise
-
blob
public org.htmlunit.corejs.javascript.NativePromise blob()Returns a promise for the body as Blob.- Returns:
- the promise
-
formData
public org.htmlunit.corejs.javascript.NativePromise formData()Returns a promise for the body as FormData.- Returns:
- the promise
-