<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Primož Kerin</title>
    <description>The latest articles on DEV Community by Primož Kerin (@primozkerin).</description>
    <link>https://dev.to/primozkerin</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F267547%2Fd38132dc-a28a-4231-ad9f-c0820dfc62ae.jpg</url>
      <title>DEV Community: Primož Kerin</title>
      <link>https://dev.to/primozkerin</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/primozkerin"/>
    <language>en</language>
    <item>
      <title>When HTTP 200 OK from API endpoint returns "error"</title>
      <dc:creator>Primož Kerin</dc:creator>
      <pubDate>Thu, 18 Jun 2020 12:05:27 +0000</pubDate>
      <link>https://dev.to/primozkerin/when-http-200-ok-from-api-endpoint-returns-error-23oa</link>
      <guid>https://dev.to/primozkerin/when-http-200-ok-from-api-endpoint-returns-error-23oa</guid>
      <description>&lt;p&gt;So this happened a while ago but I will post it here also:&lt;/p&gt;

&lt;p&gt;I was posting data to some remote API endpoint and it kept returning HTTP response with code 200 OK. This is normally a good sign, but this was it’s content:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;br&gt;
{"error": "not present"}&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;What is your first guess when you see this response content?&lt;/p&gt;

&lt;p&gt;OK, so I thought maybe the API always returns 200 and errors in it’s content. This is not the best practice but I’ve seen it a lot in many APIs. Maybe this was an error description of a case when object is not found in a database, but they could return 404 for example.&lt;/p&gt;

&lt;p&gt;However, this was not the case here because I asked them what this "error" meant and why are they returning it with 200 OK.&lt;/p&gt;

&lt;p&gt;The answer:&lt;/p&gt;

&lt;p&gt;"This is normal behavior and it actually means that no errors are present."&lt;/p&gt;

&lt;p&gt;Was your guess correct?&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
