Git Product home page Git Product logo

elixir-http_client's Introduction

Salemove.HttpClient

Build Status Hex.pm Documentation

Elixir HTTP client for JSON services built on top of tesla.

Installation

The package can be installed by adding salemove_http_client to your list of dependencies in mix.exs:

def deps do
  [
    {:salemove_http_client, "~> 0.1.0"}
  ]
end

Documentation can be found at https://hexdocs.pm/salemove_http_client.

Usage

defmodule GihubClient do
  use Salemove.HttpClient,
      base_url: "https://api.github.com/"
end

Migrating from 0.x to 1.0

Most changes are due to changes in Tesla HTTP client. Migrating guide for tesla can be seen at https://github.com/teamon/tesla/wiki/0.x-to-1.0-Migration-Guide.

Changes specific to Salemove HTTP Client

  • Salemove.HttpClient.ConnectionError struct no longer has a field message. The error message can be fetched using Exception.message/1.

Migrating from 1.x to 2.0

Module config is now deep merged with base salemove_http_client config, so when upgrading, make sure that calls to Salemove HTTP Client don't rely on the configuration being shallow merged.

Example

config :foo, Some.Module,
  adapter_options: [
    connect_timeout: 8000
]

config :salemove_http_client,
adapter_options: [
  ssl_options: [verify: :verify_none]
]

and as a result of

use Salemove.HttpClient, Application.fetch_env!(:foo, Some.Module)

with the older version the configuration would have been:

adapter_options: [
  connect_timeout: 8000
]

with 2.x and upwards it is:

adapter_options: [
  ssl_options: [verify: :verify_none],
  connect_timeout: 8000
]

To disable stats now, you can just set stats value to false in the module configuration.

License

MIT License, Copyright (c) 2017 SaleMove

elixir-http_client's People

Contributors

deiwin avatar gliavallo avatar indrekj avatar kmteras avatar laurglia avatar oskarkook avatar ostap0207 avatar sliiser avatar sm-deployer avatar sviik avatar take-five avatar zidik avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.