Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API for encoding and decode URL-encoded form data #49

Closed
michaelrsweet opened this issue Mar 21, 2023 · 2 comments
Closed

API for encoding and decode URL-encoded form data #49

michaelrsweet opened this issue Mar 21, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request priority-high
Milestone

Comments

@michaelrsweet
Copy link
Member

Add an API for encoding and decoding application/x-www-form-urlencoded form data. Proposed API:

// Decode URL-encoded form data, returning the number of variables and a pointer to a
// `cups_option_t` array of the variables. Use `cupsFreeOptions` to return memory.
extern size_t cupsFormDecode(const char *data, cups_option_t **vars) _CUPS_PUBLIC;

// Encode options as URL-encoded form data, returning an allocated string. Use `free`
// to return memory.
extern char *cupsFormEncode(size_t num_vars, cups_option_t *vars) _CUPS_PUBLIC;
@michaelrsweet michaelrsweet self-assigned this Mar 21, 2023
@michaelrsweet michaelrsweet added enhancement New feature or request priority-high labels Mar 21, 2023
@michaelrsweet michaelrsweet added this to the v3.0 milestone Mar 21, 2023
@michaelrsweet
Copy link
Member Author

[master 2eced32] Initial implementation of cupsForm APIs (Issue #49)

Still need to finish the unit tests.

@michaelrsweet
Copy link
Member Author

[master 9a3855e] Implement unit tests.

W3C forms specification defining (poorly) the application/x-www-form-urlencoded MIME media type. Unlike URLs, anything not a letter or digit needs to be percent encoded (which turned up with the unit tests...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority-high
Projects
None yet
Development

No branches or pull requests

1 participant