-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathhttp-interface.html
54 lines (54 loc) · 6.13 KB
/
http-interface.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<h2 id="http-api-for-doc-browser">HTTP API for doc-browser</h2>
<p>You can interact with this application using HTTP requests.</p>
<p>All URL should be prefixed with <code>http://localhost:<port></code>, where <code><port></code> is 7701 if the user didn't change its configuration, generally, you can use <code>doc-browser --get-port</code> to get the port.</p>
<p>If you are using Insomnia, you can import <code>insomnia.json</code>, found at the root of this repository.</p>
<p>APIs are listed below.</p>
<h2 id="get-search">GET /search</h2>
<h3 id="function">Function</h3>
<p>Search doc-browser with the given string, and return the search result as a JSON array. Detailed documentation of the type of the element of the returned array can be found at: https://qwfy.github.io/doc-browser/doc/Match.html#t:T</p>
<h3 id="get-parameters">GET Parameters:</h3>
<ul>
<li>q
<ul>
<li><strong>Values</strong>: <em>os.path, /pyos.path, forM/hh, etc.</em></li>
<li><strong>Description</strong>: String to search</li>
</ul></li>
</ul>
<h3 id="response">Response:</h3>
<ul>
<li>Status code 200</li>
<li><p>Headers: []</p></li>
<li><p>Supported content types are:</p>
<ul>
<li><code>application/json;charset=utf-8</code></li>
<li><code>application/json</code></li>
</ul></li>
<li><p>Example (<code>application/json;charset=utf-8</code>, <code>application/json</code>):</p>
<div class="sourceCode"><pre class="sourceCode javascript"><code class="sourceCode javascript">[]</code></pre></div></li>
<li><p>Example (<code>application/json;charset=utf-8</code>, <code>application/json</code>):</p>
<div class="sourceCode"><pre class="sourceCode javascript"><code class="sourceCode javascript">[<span class="op">{</span><span class="st">"vendor"</span><span class="op">:</span><span class="st">"DevDocs"</span><span class="op">,</span><span class="st">"typeConstraint"</span><span class="op">:</span><span class="kw">null</span><span class="op">,</span><span class="st">"url"</span><span class="op">:</span><span class="st">"http://localhost:7701/DevDocs/Python==3.6.4/library/os.path"</span><span class="op">,</span><span class="st">"icon"</span><span class="op">:</span><span class="st">"Python"</span><span class="op">,</span><span class="st">"collection"</span><span class="op">:</span><span class="st">"Python"</span><span class="op">,</span><span class="st">"name"</span><span class="op">:</span><span class="st">"os.path"</span><span class="op">,</span><span class="st">"version"</span><span class="op">:</span><span class="st">"3.6.4"</span><span class="op">,</span><span class="st">"module"</span><span class="op">:</span><span class="kw">null</span><span class="op">,</span><span class="st">"package"</span><span class="op">:</span><span class="kw">null</span><span class="op">}</span>]</code></pre></div></li>
<li><p>Example (<code>application/json;charset=utf-8</code>):</p>
<div class="sourceCode"><pre class="sourceCode javascript"><code class="sourceCode javascript">[<span class="op">{</span><span class="st">"vendor"</span><span class="op">:</span><span class="st">"DevDocs"</span><span class="op">,</span><span class="st">"typeConstraint"</span><span class="op">:</span><span class="kw">null</span><span class="op">,</span><span class="st">"url"</span><span class="op">:</span><span class="st">"http://localhost:7701/DevDocs/Python==3.6.4/library/os.path"</span><span class="op">,</span><span class="st">"icon"</span><span class="op">:</span><span class="st">"Python"</span><span class="op">,</span><span class="st">"collection"</span><span class="op">:</span><span class="st">"Python"</span><span class="op">,</span><span class="st">"name"</span><span class="op">:</span><span class="st">"os.path"</span><span class="op">,</span><span class="st">"version"</span><span class="op">:</span><span class="st">"3.6.4"</span><span class="op">,</span><span class="st">"module"</span><span class="op">:</span><span class="kw">null</span><span class="op">,</span><span class="st">"package"</span><span class="op">:</span><span class="kw">null</span><span class="op">},{</span><span class="st">"vendor"</span><span class="op">:</span><span class="st">"DevDocs"</span><span class="op">,</span><span class="st">"typeConstraint"</span><span class="op">:</span><span class="kw">null</span><span class="op">,</span><span class="st">"url"</span><span class="op">:</span><span class="st">"http://localhost:7701/DevDocs/Python==3.6.4/library/os.path"</span><span class="op">,</span><span class="st">"icon"</span><span class="op">:</span><span class="st">"Python"</span><span class="op">,</span><span class="st">"collection"</span><span class="op">:</span><span class="st">"Python"</span><span class="op">,</span><span class="st">"name"</span><span class="op">:</span><span class="st">"os.path"</span><span class="op">,</span><span class="st">"version"</span><span class="op">:</span><span class="st">"3.6.4"</span><span class="op">,</span><span class="st">"module"</span><span class="op">:</span><span class="kw">null</span><span class="op">,</span><span class="st">"package"</span><span class="op">:</span><span class="kw">null</span><span class="op">}</span>]</code></pre></div></li>
</ul>
<h2 id="get-summon">GET /summon</h2>
<h3 id="function-1">Function</h3>
<p>Bring the doc-browser GUI to front, and search it with the given string.</p>
<h3 id="get-parameters-1">GET Parameters:</h3>
<ul>
<li>q
<ul>
<li><strong>Values</strong>: <em>os.path, /pyos.path, forM/hh, etc.</em></li>
<li><strong>Description</strong>: String to search</li>
</ul></li>
</ul>
<h3 id="response-1">Response:</h3>
<ul>
<li>Status code 200</li>
<li><p>Headers: []</p></li>
<li><p>Supported content types are:</p>
<ul>
<li><code>application/json;charset=utf-8</code></li>
<li><code>application/json</code></li>
</ul></li>
<li><p>No response body</p></li>
</ul>