api section in faq; brighter code background
This commit is contained in:
+15
-4
@@ -24,6 +24,11 @@
|
||||
be wary of any metadata included in the files you are uploading,
|
||||
especially photos from a phone as they may contain GPS data.
|
||||
</p>
|
||||
{{if .NormalizeMIMETypes}}
|
||||
<h3>why are my html/svg/pdf uploads not being rendered?</h3>
|
||||
<p>they are being normalized for security.</p>
|
||||
{{end}}
|
||||
<h2>api usage</h2>
|
||||
<h3>how do i upload via the api?</h3>
|
||||
<p>
|
||||
send a POST request to <code>/upload</code>. for files, use multipart
|
||||
@@ -38,14 +43,20 @@
|
||||
$i}},{{end}}{{$expiry.Label}}{{end}}</code
|
||||
>. omitting an expiry will use the first expiry listed.
|
||||
</p>
|
||||
<p>
|
||||
you can also specify if you would prefer a long or short upload id, just
|
||||
append <br> <code>?idlength=short</code> to get a shorter id (10 characters),
|
||||
otherwise it defaults to long (16 character)
|
||||
</p>
|
||||
<h4>uploading the output of a command</h4>
|
||||
<code>cat super-cool-text.txt | curl -T - {{.Host}}/upload</code>
|
||||
<h4>upload a file via curl</h4>
|
||||
<code>curl -F "file=@very-cool-image.png" {{.Host}}/upload</code>
|
||||
{{if .NormalizeMIMETypes}}
|
||||
<h3>why are my html/svg/pdf uploads not being rendered?</h3>
|
||||
<p>they are being normalized for security.</p>
|
||||
{{end}}
|
||||
<h3>getting upload info</h3>
|
||||
<p>
|
||||
you can retrieve an upload's metadata by simply appending <code>/info</code> to the end of an upload, like <code>/{id}/info</code>.
|
||||
it returns all stored metadata except for the original filename.
|
||||
</p>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user