Package com.microsoft.playwright
Class Route.FulfillOptions
java.lang.Object
com.microsoft.playwright.Route.FulfillOptions
- Enclosing interface:
Route
-
Field Summary
FieldsModifier and TypeFieldDescriptionOptional response body as text.byte[]Optional response body as raw bytes.If set, equals to settingContent-Typeresponse header.Response headers.File path to respond with.APIResponseto fulfill route's request with.Response status code, defaults to200. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionOptional response body as text.setBodyBytes(byte[] bodyBytes) Optional response body as raw bytes.setContentType(String contentType) If set, equals to settingContent-Typeresponse header.setHeaders(Map<String, String> headers) Response headers.File path to respond with.setResponse(APIResponse response) APIResponseto fulfill route's request with.setStatus(int status) Response status code, defaults to200.
-
Field Details
-
body
Optional response body as text. -
bodyBytes
public byte[] bodyBytesOptional response body as raw bytes. -
contentType
If set, equals to settingContent-Typeresponse header. -
headers
Response headers. Header values will be converted to a string. -
path
File path to respond with. The content type will be inferred from file extension. Ifpathis a relative path, then it is resolved relative to the current working directory. -
response
APIResponseto fulfill route's request with. Individual fields of the response (such as headers) can be overridden using fulfill options. -
status
Response status code, defaults to200.
-
-
Constructor Details
-
FulfillOptions
public FulfillOptions()
-
-
Method Details
-
setBody
Optional response body as text. -
setBodyBytes
Optional response body as raw bytes. -
setContentType
If set, equals to settingContent-Typeresponse header. -
setHeaders
Response headers. Header values will be converted to a string. -
setPath
File path to respond with. The content type will be inferred from file extension. Ifpathis a relative path, then it is resolved relative to the current working directory. -
setResponse
APIResponseto fulfill route's request with. Individual fields of the response (such as headers) can be overridden using fulfill options. -
setStatus
Response status code, defaults to200.
-