# encodeFormData

**Kind:** Function

**Source:** [`atloria-monorepo/packages/ui-core/src/components/api-explorer/multipart.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/packages/ui-core/src/components/api-explorer/multipart.ts#L170)

Encode a FormData for transport through the try-it proxy.

The proxy speaks JSON — it has to, since it is also carrying the target URL and headers — and
a `File` does not survive `JSON.stringify` (it becomes `{}`). Before this, a proxied upload
sent an empty object and reported whatever the upstream made of it. Base64 costs a third in
size, which is why the caller caps the total; see MAX_PROXY_UPLOAD_BYTES.

## Signature

```ts
async function encodeFormData(form: FormData): Promise<{ parts: EncodedPart[]; bytes: number }>
```

## Parameters

| Name | Type |
|---|---|
| `form` | `FormData` |

**Returns:** `Promise<{ parts: EncodedPart[]; bytes: number }>`
