optools/net/addr/app/templates/usage.html
2017-10-06 14:05:56 -04:00

2.7 KiB

{% extends "base.html" %}{% block title %}r00t^2 Client Info Revealer || Usage{% endblock %}{% block body %}

Usage

Parameters

You can control how this page displays/renders. By default it will try to "guess" what you want; e.g. if you access it in Chrome, it will display this page but if you fetch via Curl, you'll get raw JSON. The following parameters control this behavior.

Note: "Enabled" parameter values can be one of y, yes, 1, or true. "Disabled" parameter values can be one of n, no, 0, or false. The parameter names are case-sensitive but the values are not.

  • json: Force rendering in JSON format
    • It will display it nicely if you're in a browser, otherwise it will return raw/plaintext JSON.
    • Use raw if you want to force raw plaintext JSON output.
  • html: Force rendering in HTML
    • It will render HTML in clients that would normally render as JSON (e.g. curl, wget).
  • raw: Force output into a raw JSON string
    • Pure JSON instead of HTML or formatted JSON. This is suitable for API usages if your client is detected wrongly (or you just want to get the raw JSON).
    • Overrides all other tags.
    • Has no effect for clients that would normally render as JSON (curl, wget, etc.).
  • tabs: Indentation for JSON output
    • Accepts a positive integer.
    • Default is 4 for "desktop" browsers (if json is enabled), and no indentation otherwise.

Examples

URL Behavior
{{ request.base_url }} Displays HTML and "Human" formatting if in a graphical browser, otherwise returns a raw, unformatted JSON string.
{{ request.base_url }}?raw=1 Renders a raw, unformatted JSON string if in a graphical browser, otherwise no effect. All other parameters ignored (if in a graphical browser).
{{ request.base_url }}?html=1 Forces HTML rendering on non-graphical clients.
{{ request.base_url }}?json=1&tabs=4 Returns JSON indented by 4 spaces for each level (you can leave "json=1" off if it's in a non-graphical browser, unless you specified "html=1").

{% endblock %}