diff --git a/index.html b/index.html index c19a58e..7dcb588 100644 --- a/index.html +++ b/index.html @@ -1,4 +1,4 @@ -

Namespaces

unfurl.api

Public variables and functions:

\ No newline at end of file +

Namespaces

unfurl.api

Public variables and functions:

\ No newline at end of file diff --git a/unfurl.api.html b/unfurl.api.html index 4ecfa51..9d27cc4 100644 --- a/unfurl.api.html +++ b/unfurl.api.html @@ -1,31 +1,26 @@ -unfurl.api documentation

unfurl.api

unfurl

(unfurl url & {:keys [follow-redirects timeout-ms user-agent max-content-length proxy-host proxy-port], :or {follow-redirects true, timeout-ms 1000, user-agent "unfurl", max-content-length 16384, proxy-host nil, proxy-port nil}})
Unfurls the given url, throwing an exception if the url is invalid, returning
-nil if the given url is nil or not supported, or a map containing some or all
-of the following keys (none of which are mandatory):
-
-  {
-    :url           - The url of the resource, according to the server
-    :title         - The title of the given url
-    :description   - The description of the given url
-    :preview-url   - The url of a preview image for the given url
-  }
-
-Options are provided as key/value pairs, with any/all of the following keys:
-
-  {
-    :follow-redirects    (default: true)     - whether to follow 30x redirects
-    :timeout-ms          (default: 1000)     - timeout in ms (used for both the socket and connect timeouts)
-    :user-agent          (default: "unfurl") - user agent string to send in the HTTP request
-    :max-content-length  (default: 16384)    - maximum length (in bytes) of content to retrieve (using HTTP range requests)
-    :proxy-host          (default: nil)      - HTTP proxy hostname
-    :proxy-port          (default: nil)      - HTTP proxy port
-  }
-
-Thrown exceptions will usually be an ExceptionInfo with the ex-data containing:
-
-  {
-    :request  - the details of the HTTP request that was attempted
-    :response - the details of the HTTP response that was received (comes directly from clj-http)
-  }
\ No newline at end of file +unfurl.api documentation

unfurl.api

unfurl

(unfurl url & {:keys [follow-redirects timeout-ms user-agent max-content-length proxy-host proxy-port http-headers], :or {follow-redirects true, timeout-ms 1000, user-agent "https://github.com/pmonks/unfurl", max-content-length 16384, proxy-host nil, proxy-port nil, http-headers nil}})

Unfurls the given url , returning nil if url is nil or not supported, or a map containing some or all of the following keys (all of which are optional):

+
    +
  • :url (String) The url of the resource, according to the server.
  • +
  • :title (String) The title of the given url.
  • +
  • :description (String) A brief textual description of the given url.
  • +
  • :preview-url (String) The url of a preview image for the given url.
  • +
+

Options are:

+
    +
  • :follow-redirects (boolean, default true): Whether to follow 30x redirects.
  • +
  • :timeout-ms (long, default 1000) Timeout in ms (used for both the socket and connect timeouts).
  • +
  • :user-agent (String, default "https://github.com/pmonks/unfurl") User agent string to send in the HTTP request. This should be either a browser identification string, an email address, or a URL, as some servers will reject requests with User Agent values that aren’t in one of these domains.
  • +
  • :max-content-length (long, default 16384) Maximum length (in bytes) of content to retrieve, using HTTP range requests (the entire content does not normally need to be retrieved in order to get the metadata unfurl uses).
  • +
  • :proxy-host (String, default nil) HTTP proxy hostname.
  • +
  • :proxy-port (long, default nil) HTTP proxy port.
  • +
  • :http-headers (a map with String keys and String values, default nil) A map of any other HTTP request headers you might want unfurl to include in the requests it makes.
  • +
+

Throws on I/O errors, usually an ExceptionInfo with the ex-data containing:

+
    +
  • :request (a map with String keys and String values) Contains the details of the HTTP request that was attempted.
  • +
  • :response (a map with String keys and String values) Contains the details of the HTTP response that was received (directly from clj-http).
  • +
+
\ No newline at end of file