All Projects → swelham → ivar

swelham / ivar

Licence: MIT license
Ivar is an adapter based HTTP client that provides the ability to build composable HTTP requests.

Programming Languages

elixir
2628 projects

Projects that are alternatives of or similar to ivar

Curio
A Blazing Fast HTTP Client
Stars: ✭ 35 (+150%)
Mutual labels:  http-client
axios-case-converter
Axios transformer/interceptor that converts snake_case/camelCase
Stars: ✭ 114 (+714.29%)
Mutual labels:  http-client
foxy
Session-based Beast/Asio wrapper requiring C++14
Stars: ✭ 61 (+335.71%)
Mutual labels:  http-client
csharp-http-client
Twilio SendGrid's C# HTTP Client for calling APIs
Stars: ✭ 25 (+78.57%)
Mutual labels:  http-client
hunt-http
http library for D, support http 1.1 / http 2.0 (http2) / websocket server and client.
Stars: ✭ 29 (+107.14%)
Mutual labels:  http-client
malloy
A C++ library providing embeddable server & client components for both HTTP and WebSocket.
Stars: ✭ 29 (+107.14%)
Mutual labels:  http-client
DrawBox
DrawBox is a multi-purpose tool to draw anything on canvas, written completely on jetpack compose.
Stars: ✭ 148 (+957.14%)
Mutual labels:  composable
heroshi
Heroshi – open source web crawler.
Stars: ✭ 51 (+264.29%)
Mutual labels:  http-client
domhttpx
domhttpx is a google search engine dorker with HTTP toolkit built with python, can make it easier for you to find many URLs/IPs at once with fast time.
Stars: ✭ 59 (+321.43%)
Mutual labels:  http-client
clj-http-hystrix
A Clojure library to wrap clj-http requests as hystrix commands
Stars: ✭ 21 (+50%)
Mutual labels:  http-client
requester
The package provides a very thin wrapper (no external dependencies) for http.Client allowing the use of layers (middleware).
Stars: ✭ 14 (+0%)
Mutual labels:  http-client
http-requests
An HTTP client abstraction that provides a common interface to several different client implementations.
Stars: ✭ 22 (+57.14%)
Mutual labels:  http-client
java-restify
Java Restify - Simple interface-based HTTP client for Java
Stars: ✭ 31 (+121.43%)
Mutual labels:  http-client
aiohttp-json-rpc
Implements JSON-RPC 2.0 using aiohttp
Stars: ✭ 54 (+285.71%)
Mutual labels:  http-client
Capturable
🚀Jetpack Compose utility library for capturing Composable content and transforming it into Bitmap Image🖼️
Stars: ✭ 365 (+2507.14%)
Mutual labels:  composable
bow-openapi
🌐 Functional HTTP client generator from an OpenAPI/Swagger specification.
Stars: ✭ 47 (+235.71%)
Mutual labels:  http-client
watermelon-http-client
GitHub Action to perform HTTP requests. Supports GraphQL!
Stars: ✭ 21 (+50%)
Mutual labels:  http-client
centra
Core Node.js HTTP client
Stars: ✭ 52 (+271.43%)
Mutual labels:  http-client
libashttp
A C++ async HTTP client library to use in asynchronous applications while communicating with REST services.
Stars: ✭ 51 (+264.29%)
Mutual labels:  http-client
http-accept
Parse Accept and Accept-Language HTTP headers in Ruby.
Stars: ✭ 69 (+392.86%)
Mutual labels:  http-client

Build Status Deps Status Hex Version Join the chat at https://gitter.im/swelham/ivar

Ivar

Ivar is an adapter based HTTP client that provides the ability to build composable HTTP requests.

The key goals of Ivar are to allow requests to be constructed in a composable manner (pipeline friendly) and to simplify building, sending and receiving requests for a number of well known http clients.

Supported Adapters

HTTP Client Adapter
HTTPoison ivar_httpoison

Usage

Add ivar to your list of dependencies in mix.exs, plus the http adapter you are going to use:

def deps do
  [
    {:ivar, "~> 0.9.0"},
    {:ivar_httpoison, "~> 0.1.0"}
  ]
end

Setup up the config for your chosen adapater

config :ivar,
  adapter: Ivar.HTTPoison

Basic usage

Ivar.get("https://example.com")
|> Ivar.send
|> Ivar.unpack
# {"<!doctype html>\n<html>...", %HTTPoison.Response{}}

JSON encoding/decoding

Ivar uses the Poison library for encoding and decoding JSON, so make sure you have it listed along side Ivar in your mix.exs.

def deps do
  [
    {:ivar, "~> 0.9.0"},
    {:poison, "~> 3.0"},
    ...
  ]
end

You can then specify that you want to send JSON when putting the request body. If the response contains the application/json content type header, the Ivar.unpack function will then decode the response for you.

Ivar.post("https://some-echo-server")
|> Ivar.put_body(%{some: "data"}, :json)
|> Ivar.send
|> Ivar.unpack
# {%{some: "data"}, %HTTPoison.Response{}}

Real world example

This is simplified extract from a real world application where Ivar is being used to send email via the mailgun service.

url = "https://api.mailgun.net/v3/domain.com/messages"
mail_data = %{to: "[email protected]", ...}
files = [{"inline", File.read!("elixir.png"), "elixir.png"}, ...]

Ivar.new(:post, url)
|> Ivar.put_auth({"api", "mailgun_api_key"}, :basic)
|> Ivar.put_body(mail_data, :url_encoded)
|> Ivar.put_files(files)
|> Ivar.send
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].