-
- local uv = require( 'uv' )
- local http = require( 'http' )
- local json = require( 'json' )
-
- _G["process"] = require('process').globalProcess()
-
- config = "http://127.0.0.1:5500"
- config = http.parseUrl( config )
- config.method = "POST"
- config.body = json.stringify({
- data = {
- str = "test",
- no = 4
- },
- false
- })
- config.headers = {{"content-type", "application/json"},
- {"content-length",#config.body}}
- --config.headers["Content-Type"] = "application/json"
- --config.headers["Content-Length"] = #config.body
-
- local req = http.request( config, p )
- req:done()
-
- uv.run()
-