Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

APIs

What are HTTP resources supposed to be?

I have taken the HTTP Basics and Rest API Basics courses and with further research I still do not understand what resources are supposed to be. All I have found is that it is a "concept at the end of a URI." But is it a file that is being written to or retrieved from? A directory of some sort?

Any elaboration on this would be great. Thanks!

1 Answer

Steven Parker
Steven Parker
231,236 Points

A "resource" is simply a source of information. It might be a file, or just some data in the server's memory. It might not be possible to tell what the exact resource is. But the server that hosts the URI conveys a representation of the information when requested. That's the important part from the client perspective, and what would be described in the API documentation.

Okay, that helps a little. I ran into the issue when I was playing with their form example but it couldn't find the resource because I gave it a file extension. And the courses don't use any file extensions so I didn't know what to save it as. I'm going to review the HTTP Basics course with that in mind. Thanks!

Steven Parker
Steven Parker
231,236 Points

HTML is common, often identified with an "htm" extension, but the actual format can be a number of things. When the resource is delivered, there may be format information in the HTTP header.