Why we won't support Shopify in Hyperlambda
Tags: discuss
Published: 2022-07-02 10:51:36

[Shopify](https://www.shopify.com/) is an amazingly popular service, I assume because it's made it incredibly easy to setup your own web shop. In addition it's an incredibly successful company, having grown from zero to billions of dollars worth in just a handful of years. However, we simply cannot support interacting with their APIs (currently)

**Disclaimer**; This article is written out of frustrations with Shopify, as an open letter to the developers and architects creating Shopify, because behind Shopify's success there's something equally dangerously sad as its commercial success in the market - Which is its lack of respect for web standards. As a web developer I love the web, I care about it, and I want it to prosper and grow. Shopify's APIs on the other hand, has absolutely no respect for web standards, and their lack of respect for web standards is quite frankly painful to watch ... :/

## Background

6 months ago I was contacted by one of our partners. He's a really smart guy, and wanted to use Magic to interact with Shopify's web API. He created a pull request for us, and notified me such that I could accept it. Obviously I was happy for contributions, so I immediately started looking at the PR, at which point I went like ...

> WUT, you KIDDING ME .....????????????????

He needed the ability to apply `Content-Type` HTTP headers on `GET` and `DELETE` HTTP requests. The reasons was that Shopify expects all HTTP requests to be decorated with `Content-Type`, including their HTTP `GET` and `DELETE` requests - And unless all HTTP requests are decorated with `Content-Type` they're rejected by Shopify's APIs.

Normally when really smart people sends me pull requests, I typically accepts them, and I am grateful for their contributions - However, this time I had to reject it. There is simply _no way_ I am going to allow for decorating HTTP `GET` and `DELETE` requests with `Content-Type` HTTP headers. To understand my reasons, realise the following ...

1. The Content-Type HTTP header was created to describe the content payload of your HTTP requests.
2. GET and DELETE requests _can't have payloads_.

To describe the problem in laymen terms, imagine refusing divers into your swimming pool before they've informed you about their wingspan.

> Shopify, you really need to fix this!

It's quite frankly embarrassing to look at, and at least as long as I'm in charge at [Aista](https://aista.com), we will not allow for decorating HTTP requests without a payload with payload HTTP headers. And the problem is not only existing in Hyperlambda. A lot of core libraries and tools have issues with this at their core. To add a Content-Type HTTP header to a C# `HttpClient` instance requires creating an empty `ContentObject`, resulting in 5 times as much code as you would normally need to create a sane HTTP GET request. This problem gives me flashback to the IE6 days to be honest with you. Please respect web standards ...

And yes I know, technically it's not _"illegal"_ to decorate an HTTP request without a content object with the `Content-Type` HTTP header - But it's also not _"illegal"_ to demand _"wingspan declarations from divers entering your pool"_ - It's just incredibly stupid ... :/