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.

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
215,958 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
215,958 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.