Skip to main content

Form URL Encoded Plugin

The form URL encoded plugin adds support for application/x-www-form-urlencoded request bodies in Drift.

1. When to Use This Plugin​

Enable this plugin when an operation in your API specification expects form fields instead of JSON.

2. Registering the Plugin​

Add the plugin to the plugins section of your Drift file:

plugins:
- name: oas
- name: form-urlencoded

3. Sending Form-Encoded Bodies​

Provide form fields as a map under body:

operations:
updatePet_FormEncoded:
target: petstore-oas:updatePet
description: "Update pet name and status via form fields"
parameters:
headers:
content-type: application/x-www-form-urlencoded
request:
body:
name: bluey-updated
status: sold
expected:
response:
statusCode: 200

If the media type is defined in your OpenAPI specification, Drift uses that definition and you do not need to repeat the Content-Type header.

4. Validation Behavior​

The form URL encoded plugin enables Drift to send form-encoded payloads for operations that define application/x-www-form-urlencoded request bodies.