Join Troy Miles for an in-depth discussion in this video Reading the query string, part of Web Servers and APIs using C++.
- [Narrator] Query strings are the part of the URL…that comes after the question mark.…They're never used to determine a route handler,…but since they are related, let's see…how to parse them in Crow.…To access the query string, you'll need the request object.…So, let's go ahead and just build…a very simple handler to test this out,…and so we're gonna say crow underscore route.…and we have an app.…The name of our handler…is going to be forward-slash query,…and we are going to have nothing in our lambda capture.…
Inside of our parameters list, we're gonna take the...…Let's go ahead and just grab them from up here...…The request and response objects,…so paste those right there, and then we have an…open and close in curly braces.…The semicolon, we're gonna open that up,…and what we're gonna do, is we're gonna say…auto first name equals R-E-Q for the request,…U-R-L underscore param, and that's with an S, params.…
And then we're gonna call the get method,…and say first name, and we're gonna do the same thing…for the last name,…
- Working with Crow, the C++ micro web framework
- Deploying containers to Heroku
- Building websites and webpages
- Accessing data from a database
- Accessing data via RESTful APIs
- Creating API endpoints
- Running WebSockets on Heroku
Skill Level Intermediate
1. Installing Our Tools
2. Deploying to Heroku
Installing the Heroku CLI1m 17s
3. Building Websites
4. Data Access
5. RESTful APIs
6. WebSockets and Crow
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.