- Serverless Programming Cookbook
- Heartin Kanikathottu
- 139字
- 2025-04-04 15:02:17
Parts of a URL
Consider a URL: http://www.heartin.tech/books/serverless-cookbook?format=pdf#index. Here, http is the scheme, www.heartin.tech is the host, books and serverless-cookbook are resources, format=pdf is a query string, and #index is a fragment. You can specify a variable path param as books/{book}, and substitute a value for {book} when making requests. Path parameters should be preferred over query strings for specifying resources. Query strings are generally used for filtering results with GET requests (for example, pagination and sorting). The #index part is called a fragment, and it points to a location within an HTML file, but is less frequently used with REST.
A more detailed discussion of REST and HTTP is beyond the scope of this book. Please read other books and articles to learn more.