Skip to content

request struct parsing#1

Open
toasted226 wants to merge 3 commits intomainfrom
feat/request-struct
Open

request struct parsing#1
toasted226 wants to merge 3 commits intomainfrom
feat/request-struct

Conversation

@toasted226
Copy link
Collaborator

@toasted226 toasted226 commented Oct 4, 2025

Implemented parsing of request into struct using an enum for the method, string for uri and a hashmap for headers. I've also moved the http request struct logic into a different module. This PR does not include parsing of the request body.

The following update was meant to be another PR but I pushed without realising I hadn't changed branch lol:

  • Added request body parsing, this currently just parses into a String type, regardless of headers
  • Added a simple router structure to allow adding endpoints easily, this still needs to change a bit to allow for ring-compatible middleware
  • Added a simple response structure that's returned from the router, containing a status, headers and a response.
  • The response can be configured to return headers and a proper status code from the list of available status codes.

Copy link

@merveillevaneck merveillevaneck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is fire

@toasted226
Copy link
Collaborator Author

there's another PR inside this one lol

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.

3 participants

Comments