axios for fp-ts.
Originally extracted from elm-ts.
It works with io-ts types.
For example, you can get a list of most recent posts from my blog:
import * as t from 'io-ts'
import * as E from 'fp-ts/lib/Either'
import { toTaskEither } from '@tetsuo/axios-ts/lib/TaskEither'
import { get } from '@tetsuo/axios-ts/lib/Client'
import { expected } from '@tetsuo/axios-ts/lib/Expected'
const Entry = t.type({
title: t.string,
description: t.string,
slug: t.string,
})
const Response = t.type({
entries: t.array(Entry),
})
const program = toTaskEither(get('https://ogu.nz/index.json', expected(Response)))
program().then(E.bimap(console.error, console.log))