Skip to content

Method: urls.insert

Robert Durfee edited this page Aug 23, 2020 · 4 revisions

Creates a URL resource using the data included in the request.

(The REST API endpoint handler code can be found here.)

HTTP Request

POST https://api.urls.durfee.io/urls

Path Parameters

No path parameters are allowed.

Query Parameters

No query parameters are allowed.

Request Body

The request body contains data with the following structure:

{
    "url": string
}
Fields
url string

The complete URL for the URL resource.

Response Body

If successful, the response body contains data with the following structure:

{
    "id": string,
    "url": string
}
Fields
id string

The unique identifier for the URL resource. This identifier is defined by the server.
url string

The complete URL for the URL resource.

curl Example

curl \
    --cacert ~/.urls/ca.cert.pem \
    -X POST \
    "https://api.urls.durfee.io/urls" \
    -H "Content-Type: application/json" \
    -d '{
      "url": "https://sinews.siam.org/Details-Page/detecting-gerrymandering-with-mathematics"
    }'

URL Shortener API

Clone this wiki locally