Elm, JSON decoder: How to decode an empty string?
<p>What's the best way to handle an empty (no string at all) response? </p>

<p>Although the response code is 200, Elm returns an error because an empty response is not a valid JSON.</p>

<p>Here is my current code:</p>

<pre><code>decodeAlwaysTrue : Json.Decode.Decoder Bool
decodeAlwaysTrue =
  Json.Decode.succeed True

Http.send Http.defaultSettings httpConfig
  |&gt; Http.fromJson decodeAlwaysTrue
  |&gt; Task.perform FetchFail DeleteUserSuccess
</code></pre>

<p>EDIT1:</p>

<p>This a POST action so I can't use <a href="http://package.elm-lang.org/packages/evancz/elm-http/3.0.1/Http#getString" rel="nofollow">getString</a>.</p>