Package com.microsoft.playwright.options
Interface FormData
- All Known Implementing Classes:
FormDataImpl
public interface FormData
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 Summary
Modifier and TypeMethodDescriptionstatic FormDatacreate()Creates new instance ofFormData.Sets a field on the form.Sets a field on the form.set(String name, FilePayload value) Sets a field on the form.Sets a field on the form.Sets a field on the form.
-
Method Details
-
create
Creates new instance ofFormData.- Since:
- v1.18
-
set
Sets a field on the form. File values can be passed either asPathor asFilePayload.- Parameters:
name- Field name.value- Field value.- Since:
- v1.18
-
set
Sets a field on the form. File values can be passed either asPathor asFilePayload.- Parameters:
name- Field name.value- Field value.- Since:
- v1.18
-
set
Sets a field on the form. File values can be passed either asPathor asFilePayload.- Parameters:
name- Field name.value- Field value.- Since:
- v1.18
-
set
Sets a field on the form. File values can be passed either asPathor asFilePayload.- Parameters:
name- Field name.value- Field value.- Since:
- v1.18
-
set
Sets a field on the form. File values can be passed either asPathor asFilePayload.- Parameters:
name- Field name.value- Field value.- Since:
- v1.18
-