Skip to content

feat: add FormData support to rawRequest for multipart uploads#429

Open
GFlores17 wants to merge 1 commit intolionralfs:mainfrom
GFlores17:feat/inventory-upload-formdata-support
Open

feat: add FormData support to rawRequest for multipart uploads#429
GFlores17 wants to merge 1 commit intolionralfs:mainfrom
GFlores17:feat/inventory-upload-formdata-support

Conversation

@GFlores17
Copy link
Copy Markdown

Summary

Extends rawRequest in client.ts to support multipart/form-data
requests alongside the existing application/json behavior.

Changes

  • Updated RequestOptions type in types.ts to accept FormData
    in addition to Record<string, unknown>
  • Updated rawRequest in client.ts to check if data is a
    FormData instance and skip JSON stringification and manual
    Content-Type header in that case, allowing fetch to set the
    correct multipart/form-data header automatically

Motivation

Required groundwork for implementing the inventory upload endpoints
(related to #78). The Discogs inventory upload API expects
multipart/form-data with a CSV file, which the current
implementation doesn't support.

Testing

All existing tests pass — no current behavior is affected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant