<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>REST on Coderrob</title><link>https://coderrob.com/tags/rest/</link><description>Recent content in REST on Coderrob</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Sun, 01 Sep 2024 19:01:56 -0500</lastBuildDate><atom:link href="https://coderrob.com/tags/rest/index.xml" rel="self" type="application/rss+xml"/><item><title>Partial Updates with PATCH: Targeting Only What Needs to Change</title><link>https://coderrob.com/posts/partial-updates-with-patch-targeting-only-what-needs-to-change/</link><pubDate>Sun, 01 Sep 2024 19:01:56 -0500</pubDate><guid>https://coderrob.com/posts/partial-updates-with-patch-targeting-only-what-needs-to-change/</guid><description>&lt;p&gt;When working with RESTful APIs, there are times when you need to update an entire resource, and other times when you only need to tweak a specific part of it.&lt;/p&gt;
&lt;p&gt;This is where the &lt;code&gt;PATCH&lt;/code&gt; method shines. Unlike &lt;code&gt;PUT&lt;/code&gt;, which expects the complete resource object to be sent in the request body, &lt;code&gt;PATCH&lt;/code&gt; is all about making targeted updates.&lt;/p&gt;
&lt;p&gt;You provide the resource’s ID in the URL, and only the properties you want to change in the request body.&lt;/p&gt;</description></item><item><title>A Quick Guide to Designing RESTful Endpoints for Your API</title><link>https://coderrob.com/posts/a-quick-guide-to-designing-restful-endpoints-for-your-api/</link><pubDate>Sun, 01 Sep 2024 16:45:12 -0500</pubDate><guid>https://coderrob.com/posts/a-quick-guide-to-designing-restful-endpoints-for-your-api/</guid><description>&lt;p&gt;Let’s dive into the world of RESTful API design, especially for those of you transitioning from Java or other back-end heavy environments.&lt;/p&gt;
&lt;p&gt;One of the common mistakes I see everyday is naming API endpoints based on the actions they perform, using prefixes like &lt;code&gt;/submitSomething/&lt;/code&gt;, &lt;code&gt;/startSomething/&lt;/code&gt;, &lt;code&gt;/getSomething/&lt;/code&gt;, or &lt;code&gt;/updateSomething/&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;While this might feel natural for function naming, it’s not the &lt;em&gt;RESTful&lt;/em&gt; way to do things.&lt;/p&gt;
&lt;h2 id="rest-basics-start-with-the-resource"&gt;REST Basics: Start with the Resource&lt;/h2&gt;
&lt;p&gt;When designing a RESTful API, everything starts with the &lt;strong&gt;resource&lt;/strong&gt;. If you can name it (think nouns), then it’s probably a resource.&lt;/p&gt;</description></item><item><title>Building Better REST APIs: A Hybrid Approach with JSend and JSON:API Guidelines</title><link>https://coderrob.com/posts/building-better-rest-apis/</link><pubDate>Mon, 01 May 2023 18:00:00 -0600</pubDate><guid>https://coderrob.com/posts/building-better-rest-apis/</guid><description>&lt;p&gt;This hybrid API design guide combines elements from both &lt;a href="https://github.com/omniti-labs/jsend"&gt;JSend&lt;/a&gt; and &lt;a href="https://jsonapi.org/"&gt;JSON:API&lt;/a&gt; to create a powerful and user-friendly approach for developing REST APIs. By adopting the best practices from both, this guide offers a consistent and maintainable API design.&lt;/p&gt;
&lt;h2 id="versioning"&gt;Versioning&lt;/h2&gt;
&lt;p&gt;API versioning can be achieved using a variety of methods such as URI-based route prefix, version in the header of the request, or as a query string value.&lt;/p&gt;
&lt;p&gt;The most common approach is using a URI-based route prefix for RESTful routes to define versions. This approach requires including the API version identifier as a part of the URL path, preferably as the first segment. For example, the API endpoint URL could look like:&lt;/p&gt;</description></item><item><title>Netlify Functions RESTful API Without Express</title><link>https://coderrob.com/posts/netlify-functions-restful-api-without-express/</link><pubDate>Sun, 14 Nov 2021 12:27:52 -0600</pubDate><guid>https://coderrob.com/posts/netlify-functions-restful-api-without-express/</guid><description>&lt;h2 id="what-are-netlify-functions"&gt;What are Netlify Functions?&lt;/h2&gt;
&lt;p&gt;Netlify Functions provide a simple way to build a serverless API layer for any front-end projects.&lt;/p&gt;
&lt;p&gt;These serverless functions are executed atop AWS&amp;rsquo;s Lambda platform. The rule here is keep it simple&amp;hellip; keep it safe. No, wait, keep it simple, and keep it fast.&lt;/p&gt;
&lt;p&gt;These functions have a default timeout of 10 seconds. Netlify does support background functions that can run around 15 minutes, but focus here is on the short-lived functions.&lt;/p&gt;</description></item></channel></rss>