mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
http: send headers and request data
This commit is contained in:

committed by
Alexander Medvednikov

parent
57880aed18
commit
a62e6b127a
@ -3,11 +3,11 @@ module http
|
||||
import net
|
||||
import strings
|
||||
|
||||
fn http_do(port int, method, host_name, path string) ?Response {
|
||||
fn (req &Request) http_do(port int, method, host_name, path string) ?Response {
|
||||
bufsize := 512
|
||||
rbuffer := [512]byte
|
||||
mut sb := strings.new_builder(100)
|
||||
s := build_request_headers('', method, host_name, path)
|
||||
s := req.build_request_headers(method, host_name, path)
|
||||
|
||||
client := net.dial( host_name, port) or { return error(err) }
|
||||
client.send( s.str, s.len )
|
||||
|
Reference in New Issue
Block a user