Skip to content

Commit

Permalink
add Example codes for HTTP.sniff() (#731)
Browse files Browse the repository at this point in the history
  • Loading branch information
AtsushiSakai authored Jul 1, 2021
1 parent 0bc0369 commit ed987aa
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/sniff.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@ const WHITESPACE = Set{UInt8}([UInt8('\t'),UInt8('\n'),UInt8('\u0c'),UInt8('\r')
If a mimetype can't be determined appropriately, `"application/octet-stream"` is returned.
Supports JSON detection through the `HTTP.isjson(content)` function.
## Examples
```julia
julia> HTTP.sniff("Hello world!!")
"text/plain; charset=utf-8"
julia> HTTP.sniff("<html><body>Hello world!!</body></html>")
"text/html; charset=utf-8"
julia> HTTP.sniff("{\"a\": -1.0}")
"application/json; charset=utf-8"
```
"""
function sniff end

Expand Down

0 comments on commit ed987aa

Please sign in to comment.