Playwright / Quiz
Payload Mechanics: data, form, multipart
How APIRequestContext encodes bodies: JSON via data, urlencoded via form, files via multipart, plus params, failOnStatusCode, and context disposal.
- Difficulty
- Medium
- Format
- Quiz
- Points
- 150
- Estimate
- 10 min
// MISSION BRIEF
Your Mission
The existing API quiz taught you the request fixture exists. This one makes you fluent in its dialect: three body encodings, query params, the throw-on-error switch, and the cleanup call everyone forgets.
Seven questions. Speed bonus active.
// FIRST CONTACT
Battle teaser
await request.post('/api/users', { data: { name: 'Ada' } }) sends:
- AA JSON body with content-type application/json set automatically, objects passed via data are serialized for you
- BNothing; data is not a valid option
- CA multipart form with one field
- DA query string ?name=Ada
Answers, scoring, hints, and the full battle stay sealed.
// SKILL TAGS
playwrightapi-testingrequest-contextpayloads