Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
65c7e8e0
Commit
65c7e8e0
authored
May 13, 2016
by
Marcel Stör
Browse files
Use
http://httpbin.org
in examples
parent
f0c10343
Changes
1
Hide whitespace changes
Inline
Side-by-side
docs/en/modules/http.md
View file @
65c7e8e0
...
...
@@ -36,7 +36,7 @@ Executes a HTTP DELETE request.
#### Example
```
lua
http
.
delete
(
'http
s
://
connor.example.com/john
'
,
http
.
delete
(
'http://
httpbin.org/delete
'
,
""
,
""
,
function
(
code
,
data
)
...
...
@@ -65,7 +65,7 @@ Executes a HTTP GET request.
#### Example
```
lua
http
.
get
(
"http
s
://
www.vowstar.com/nodemcu/
"
,
nil
,
function
(
code
,
data
)
http
.
get
(
"http://
httpbin.org/ip
"
,
nil
,
function
(
code
,
data
)
if
(
code
<
0
)
then
print
(
"HTTP request failed"
)
else
...
...
@@ -92,7 +92,7 @@ Executes a HTTP POST request.
#### Example
```
lua
http
.
post
(
'http://
json.example.com/something
'
,
http
.
post
(
'http://
httpbin.org/post
'
,
'Content-Type: application/json\r\n'
,
'{"hello":"world"}'
,
function
(
code
,
data
)
...
...
@@ -122,7 +122,7 @@ Executes a HTTP PUT request.
#### Example
```
lua
http
.
put
(
'http://
db.example.com/items.php?key=deckard
'
,
http
.
put
(
'http://
httpbin.org/put
'
,
'Content-Type: text/plain\r\n'
,
'Hello!\nStay a while, and listen...\n'
,
function
(
code
,
data
)
...
...
@@ -153,7 +153,7 @@ Execute a custom HTTP request for any HTTP method.
#### Example
```
lua
http
.
request
(
"http
s
://
www.example.com
"
,
"HEAD"
,
""
,
""
,
function
(
code
,
data
)
http
.
request
(
"http://
httpbin.org
"
,
"HEAD"
,
""
,
""
,
function
(
code
,
data
)
if
(
code
<
0
)
then
print
(
"HTTP request failed"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment