Skip to content

Add parsing query parameters#4

Open
Kiyoshika wants to merge 3 commits intoinfraredCoding:masterfrom
Kiyoshika:feat/query-parameters
Open

Add parsing query parameters#4
Kiyoshika wants to merge 3 commits intoinfraredCoding:masterfrom
Kiyoshika:feat/query-parameters

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
@Kiyoshika Kiyoshika marked this pull request as ready for review January 22, 2023 23:09
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