ipfinder v1.0.0 Ipfinder View Source

Documentation for Ipfinder.

Link to this section Summary

Types

List of options to all request functions.

Result returned from request/3, get/2, post/2, put/2, etc.

Result returned from request!/3, get!/2, post!/2, put!/2, etc.

Functions

Get details for an Your IP address.

A shortcut for request(:delete, url, options).

A shortcut for request!(:delete, url, options).

A shortcut for request(:get, url, options).

A shortcut for request!(:get, url, options).

Get details for an IP address.

Get details for an AS number.

Get Domain IP

Get list Domain By ASN, Country,Ranges

Get Domain History IP

Get details for an Organization name.

Get details for an API Token .

A shortcut for request(:head, url, options).

A shortcut for request!(:head, url, options).

A shortcut for request(:options, url, options).

A shortcut for request!(:options, url, options).

A shortcut for request(:patch, url, options).

A shortcut for request!(:patch, url, options).

A shortcut for request(:post, url, options).

A shortcut for request!(:post, url, options).

A shortcut for request(:put, url, options).

A shortcut for request!(:put, url, options).

Sends an HTTP request.

Starts a linked worker process for use with the direct option.

Starts a worker process for use with the direct option.

Ensures that HTTPotion and its dependencies are started.

Link to this section Types

Link to this type

http_opts()

View Source
http_opts() :: [
  body: binary() | charlist(),
  headers: [{atom() | String.Chars.t(), String.Chars.t()}],
  query: %{optional(String.Chars.t()) => String.Chars.t()},
  timeout: timeout(),
  basic_auth: {List.Chars.t(), List.Chars.t()},
  stream_to: pid() | port() | atom() | {atom(), node()},
  direct: pid() | port() | atom() | {atom(), node()},
  ibrowse: keyword(),
  auto_sni: boolean(),
  follow_redirects: boolean()
]

List of options to all request functions.

  • body - request body
  • headers - HTTP headers (e.g. ["Accept": "application/json"])
  • query - URL query string (e.g. %{page: 1})
  • timeout - timeout in milliseconds
  • basic_auth - basic auth credentials (e.g. {"user", "password"})
  • stream_to - if you want to make an async request, reference to the process
  • direct - if you want to use ibrowse's direct feature, reference to

           the worker spawned by [`spawn_worker_process/2`](#spawn_worker_process/2) or [`spawn_link_worker_process/2`](#spawn_link_worker_process/2)
  • ibrowse - options for ibrowse
  • auto_sni - if true and the URL is https, configures the server_name_indication ibrowse/ssl option

             to be the host part of the requestedURL
  • follow_redirects - if true and a response is a redirect, re-requests with header[:Location]
Link to this type

http_result()

View Source
http_result() ::
  HTTPotion.Response.t()
  | %HTTPotion.AsyncResponse{id: term()}
  | %HTTPotion.ErrorResponse{message: term()}

Result returned from request/3, get/2, post/2, put/2, etc.

Link to this type

http_result_bang()

View Source
http_result_bang() ::
  HTTPotion.Response.t() | %HTTPotion.AsyncResponse{id: term()}

Result returned from request!/3, get!/2, post!/2, put!/2, etc.

Link to this section Functions

Get details for an Your IP address.

Parameters

  • this - Ipfinder

Examples

{:ok, auth} = Ipfinder.authentication(Ipfinder)
Link to this function

call(this, path, format \\ "json")

View Source

call to server

Parameters

  • this - Ipfinder
  • path - specific path of asn, IP address, ranges, Firewall,Token status
  • format- available format json jsonp php xmland Firewall format
Link to this function

delete(url, options \\ [])

View Source

A shortcut for request(:delete, url, options).

A shortcut for request!(:delete, url, options).

A shortcut for request(:get, url, options).

A shortcut for request!(:get, url, options).

Link to this function

getAddressInfo(this, path)

View Source

Get details for an IP address.

Parameters

  • this - Ipfinder
  • path - IP address.

    Examples

{:ok, ip} = Ipfinder.getAddressInfo(Ipfinder,"1.0.0.0")

Get details for an AS number.

Parameters

  • this - Ipfinder
  • path - AS number.

    Examples

{:ok, asn} = Ipfinder.getAsn(Ipfinder,"as1")

Get Domain IP

Parameters

  • this - Ipfinder
  • path - The API supports passing in a single website name domain name

    Examples

{:ok, range} = Ipfinder.getDomain(Ipfinder,"google.com")

Get list Domain By ASN, Country,Ranges

Parameters

  • this - Ipfinder
  • by - The API supports passing in a single ASN,Country,Ranges

    Examples

{:ok, range} = Ipfinder.getDomainHistory(Ipfinder,"DZ")
Link to this function

getDomainHistory(this, path)

View Source

Get Domain History IP

Parameters

  • this - Ipfinder
  • path - The API supports passing in a single website name domain name

    Examples

{:ok, range} = Ipfinder.getDomainHistory(Ipfinder,"google.com")
Link to this function

getFirewall(this, path, formats)

View Source

Get Firewall data

Parameters

  • this - Ipfinder
  • path - AS number, alpha-2 country only.
  • formats - list formats supported

    Examples

{:ok, range} = Ipfinder.getFirewall(Ipfinder,"DZ",'nginx_deny')

Get details for an Organization name.

Parameters

  • this - Ipfinder
  • path - Organization name.

    Examples

{:ok, range} = Ipfinder.getRanges(Ipfinder,"Telecom Algeria")

Get details for an API Token .

## Examples

{:ok, status} = Ipfinder.getStatus(Ipfinder)
Link to this function

handle_response(response)

View Source

A shortcut for request(:head, url, options).

A shortcut for request!(:head, url, options).

Link to this function

new(token \\ "free", baseUrl \\ "https://api.ipfinder.io/v1/")

View Source

Constructor

Parameters

  • token - add your token
  • baseUrl - add proxy pass
Link to this function

options(url, options \\ [])

View Source
options(String.Chars.t(), http_opts()) :: http_result()

A shortcut for request(:options, url, options).

Link to this function

options!(url, options \\ [])

View Source

A shortcut for request!(:options, url, options).

A shortcut for request(:patch, url, options).

A shortcut for request!(:patch, url, options).

A shortcut for request(:post, url, options).

A shortcut for request!(:post, url, options).

Link to this function

process_options(options)

View Source
Link to this function

process_request_body(body)

View Source
Link to this function

process_request_headers(headers)

View Source
Link to this function

process_request_headers(headers, body)

View Source
Link to this function

process_request_headers(headers, body, options)

View Source
Link to this function

process_response_body(body)

View Source
Link to this function

process_response_body(headers, body)

View Source
Link to this function

process_response_chunk(body)

View Source
Link to this function

process_response_headers(headers)

View Source
Link to this function

process_response_location(response)

View Source
Link to this function

process_status_code(status_code)

View Source
Link to this function

process_url(url, options)

View Source

A shortcut for request(:put, url, options).

A shortcut for request!(:put, url, options).

Link to this function

redirect_method(response, method)

View Source
Link to this function

request(method, url, options \\ [])

View Source
request(atom(), String.Chars.t(), http_opts()) :: http_result()

Sends an HTTP request.

See the type documentation of http_opts for a description of options.

Link to this function

request(method, url, body, headers, options)

View Source
This function is deprecated. Use request/3 instead.
Link to this function

request!(method, url, options \\ [])

View Source

Like request/3, but raises HTTPotion.HTTPError if failed.

Link to this function

request_direct(conn_pid, method, url, body \\ "", headers \\ [], options \\ [])

View Source
This function is deprecated. Use request/3 with 'direct' option instead.
Link to this function

spawn_worker_process(url, options \\ [])

View Source

Starts a worker process for use with the direct option.

Ensures that HTTPotion and its dependencies are started.

Link to this function

stop_worker_process(pid)

View Source

Stops a worker process started with spawn_worker_process/2 or spawn_link_worker_process/2.

Link to this function

transformer(target, method, url, options)

View Source