This page contains frequently asked questions (FAQs) about the API for Lens, a campus network information system.
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.cites.illinois.edu/lens/uiuc-lens/device?content-type=text/html
This query:
https://lens-api.cites.illinois.edu/lens/uiuc-lens/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.
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.
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.
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.