Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Development Tools HTTP Basics Introduction to HTTP Sending Data with a GET Request

Max Botez
Max Botez
5,146 Points

I cannot understand what exactly do I need to insert it?

Hi guys, I am stuck on this quiz. Not sure exactly what to do :(

get /books?get=firstname&type=paper - like this?

Tim Strand
Tim Strand
22,458 Points

you dont need to specify the get again. sb id?var=val&var=val etc for a valid query string

Max Botez
Max Botez
5,146 Points

still, I didn't get it :(

I specified as you said but something is wrong

I am stuck in the same question as you, it is obvious that the question needs rewording, I have no clue what put in it either.

2 Answers

David Lin
David Lin
35,863 Points

The first parameter is prefixed with a question mark (?), the values are separated with an equal sign (=), and other parameters are prefixed with ampersands (&) ...

Like this:

GET /books?type=kindle&sort=popular
Max Botez
Max Botez
5,146 Points

Thanks! But in case if you want to specify 3 or 4 parameters like a type sort availability and price. Can I do it like in this way?

David Lin
David Lin
35,863 Points

Max, just separate any other parameters with &, like this ...

GET /books?type=kindle&sort=popular&availability=true&price=10
Max Botez
Max Botez
5,146 Points

Aha! yes, I've got. Thanks a lot, David :)

David Lin
David Lin
35,863 Points

Sure thing, Max!