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

URL query parameters? #36

Open
mooseyboots opened this issue Aug 3, 2023 · 3 comments
Open

URL query parameters? #36

mooseyboots opened this issue Aug 3, 2023 · 3 comments

Comments

@mooseyboots
Copy link

hi, i thought i might take a look at this for mastodon.el and/or fedi.el.

i'm a little surprised that plz doesn't have a params arg taking an alist of form data parameters, which is how i'm set up with my http layers.

whats the usual way to send them with plz? i'm not thinking of alists in :body for POST requests, but GET requests that take them in the URL itself, i.e. ?q=xyz.

i can't see any mention of this in the readme, nor examples covering it. probably because it's too obvious.

@alphapapa
Copy link
Owner

If you mean URL query parameters, plz doesn't handle that itself, it just accepts a URL. You can use the built-in url library to build a URL with query parameters, e.g.

https://github.com/alphapapa/ement.el/blob/60e9a50b8a230c00d92f639ba25040944bcda9ab/ement-api.el#L95-L98

It's a bit awkward to do so, so I'm not necessarily opposed to adding support for this to plz.

@mooseyboots mooseyboots changed the title form data parameters? URL query parameters? Aug 4, 2023
@mooseyboots
Copy link
Author

ack sorry yes i meant query parameters. i took a quick look at ement.el after posting here to see what you do, and found those lines.

and seeing that, i realized that the point of plz.el isn't to do away w url.el entirely, but maybe more just to avoid its pitfalls.

in fedi.el and lem.el i found they're the most handy thing to have streamlined and simplified. but others' usage needs may differ from mine.

@alphapapa
Copy link
Owner

Yes, plz is intended to provide an alternative to url-retrieve, not all of url and its libraries.

It would be nice to have a simpler API for URL-building than the one in the linked code, but OTOH, such code is usually written once and then not modified frequently, so I'm not sure a new API would be worth it.

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

No branches or pull requests

2 participants