Networking, Lens, Lens API Frequently Asked Questions
If I use IE, I get the error: "Cannot find a Content-Type supported by your client."
IE requires that you include a content-type request parameter. Supported types are text/x-yaml, text/xml, text/html, and text/x-json. A request for text/html will return YAML wrapped in HTML <pre> tags, so to get IE to display the plain-text YAML, you need to use text/html. If you use text/x-yaml, IE will prompt you to find something to open the document or save it. It is recommended you just use text/html or text/xml in IE.
(returns YAML wrapped in an HTML page, but will display in IE) https://lens-api.techservices.illinois.edu/web/device?content-type=text/html
This query:
https://lens-api.techservices.illinois.edu/web/device?content-type=text/xml
will return XML, which IE will also display.
Firefox will default to a simple text display (YAML) if no content-type is specified.
Do I have to use the web interface?
No, access to the Lens API can be done via a programming language of your choice as long as it can perform HTTPS GET requests using Basic Auth. A response encoding (XML, JSON, or YAML) that your program can parse needs to be selected. Some examples of perl scripts can be found at the Common LENS API Requests page.
Why can't I use the HTTP POST method? Is it supported?
The Lens API does not presently accept the POST method for queries. You should issue your queries with GET requests and supply query parameters in the URL query string.
There isn't anything wrong with the POST method. POST wouldn't have to rely on potentially giant URLs. Its content is somewhat more difficult to intercept and observe. These facts might make POST attractive for handling in Javascript client-side apps. However, the capability will require development and testing that we didn't want to delay a first release. We are also considering other uses for POST as an input rather than query method. Further consideration (and your feedback) will be useful for deciding just what we will do with POST.
My results do not look correct. To whom can I talk about this?
The Lens team can be reached at lens@illinois.edu. We would be glad to work with you on constructing the proper query to retrieve your data.