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

Add parsing query parameters #4

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Kiyoshika
Copy link

@Kiyoshika Kiyoshika commented Jan 22, 2023

So I've been wanting to work on something like this, coincidentally I found this project.

I had my attempt at trying to implement parsing query parameters, a quick breakdown of how it works:

  1. take the received URL
  2. parse URL and add parameters into struct and clean up original URL to pass it along to render the appropirate template
  3. clear parameters after usage for the next request

I attached a demo video to see it in action. Side note about Postman, for some reason for the request to go through you have to refresh the page. Not sure why that is, but otherwise it works the same as manually manipulating the URL by hand (as I did the first couple times)

cerveur.parameters.mp4

@Kiyoshika Kiyoshika changed the title Added parsing query parameters Add parsing query parameters Jan 22, 2023
@Kiyoshika Kiyoshika marked this pull request as draft January 22, 2023 23:00
@Kiyoshika
Copy link
Author

Marked for draft as I didn't properly test paramGet - working on fixing those issues now.

I was comparing a char* with a struct Parameter* which obviously is not going to work. Instead I'm using a dummy struct for the search key
Forgot to free url_copy and params->parameters pointers.
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