mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
872 B
872 B
class: FormData
- langs: java
The [FormData] is used create form data that is sent via [APIRequestContext].
import com.microsoft.playwright.options.FormData;
...
FormData form = FormData.create()
.set("firstName", "John")
.set("lastName", "Doe")
.set("age", 30);
page.request().post("http://localhost/submit", RequestOptions.create().setForm(form));
method: FormData.create
- returns: <[FormData]>
Creates new instance of [FormData].
method: FormData.set
- returns: <[FormData]>
Sets a field on the form. File values can be passed either as Path
or as FilePayload
.
param: FormData.set.name
name
<[string]>
Field name.
param: FormData.set.value
name
<[string]|[boolean]|[int]|[Path]|[Object]>name
<[string]> File namemimeType
<[string]> File typebuffer
<[Buffer]> File content
Field value.