mozilla / page-metadata-service

DEPRECATED - A RESTful service that returns the metadata about a given URL.
Mozilla Public License 2.0
19 stars 8 forks source link

Allow for optional charset in content-type header #46

Closed pdehaan closed 8 years ago

pdehaan commented 8 years ago

Now with Content-Type: application/json; charset=utf-8 support!

$ http POST http://localhost:7001/v1/metadata urls:='["https://bing.com"]' --json

HTTP/1.1 200 OK
Connection: keep-alive
Content-Length: 436
Content-Type: application/json; charset=utf-8
Date: Thu, 11 Aug 2016 02:49:29 GMT
ETag: W/"1b4-DvvSqpJmsS3xmDhR9F8sNQ"
X-Powered-By: Express

{
    "error": "",
    "urls": {
        "https://bing.com": {
            "description": "Bing helps you turn information into action, making it faster and easier to go from searching to doing.",
            "favicon_url": "https://bing.com/fd/s/a/hp/bing.svg",
            "images": [
                {
                    "entropy": 1,
                    "height": 500,
                    "url": "data://undefinedimage/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAEALAAAAAABAAEAAAIBTAA7",
                    "width": 500
                }
            ],
            "original_url": "https://bing.com",
            "title": "Bing",
            "url": "https://bing.com"
        }
    }
}

Fixes #45

jaredlockhart commented 8 years ago

r+!