Fix CURL snippet format

#9
by pengqun - opened

Problem

The current CURL snippet generation has a Incorrect Header Format issue: headers were being formatted using JSON.stringify(headers) which produces invalid CURL syntax like -H {"Content-Type":"application/json"} instead of the correct -H "Content-Type: application/json" format.

image.png

Solution

This PR address the issue by replacing JSON.stringify(headers) with proper CURL header formatting. Each header is now correctly formatted as -H "key: value", and multiple headers are properly separated with line continuation ().

I tested and verified this change in this forked space: https://huggingface.co/spaces/pengqun/hub-api-playground

image.png

pengqun changed pull request status to open
Ready to merge
This branch is ready to get merged automatically.

Sign up or log in to comment