module EnotasNfe::Connection

Private Instance Methods

connection() click to toggle source
# File lib/enotas_nfe/connection.rb, line 7
def connection
  options = {
    headers: {
      "Content-Type": "application/json",
      "Accept": "application/json",
      "User-Agent": "Enotas ruby client"
    },
    url: endpoint,
    ssl: {verify: false}
  }

  Faraday.new(options) do |connection|
    connection.use Middleware, auth_token
    connection.use Faraday::Response::ParseJson

    connection.request :multipart
    connection.adapter :net_http
  end
end