mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
all: updateimport ()
and []array
This commit is contained in:
@ -3,11 +3,9 @@
|
||||
// that can be found in the LICENSE file.
|
||||
module http
|
||||
|
||||
import (
|
||||
time
|
||||
arrays
|
||||
strings
|
||||
)
|
||||
import time
|
||||
import arrays
|
||||
import strings
|
||||
|
||||
pub struct Cookie {
|
||||
pub mut:
|
||||
|
@ -1,7 +1,5 @@
|
||||
import (
|
||||
net.http
|
||||
time
|
||||
)
|
||||
import net.http
|
||||
import time
|
||||
|
||||
struct SetCookieTestCase {
|
||||
cookie &http.Cookie
|
||||
|
@ -128,7 +128,7 @@ pub fn get_text(url string) string {
|
||||
}
|
||||
|
||||
pub fn url_encode_form_data(data map[string]string) string {
|
||||
mut pieces := []string
|
||||
mut pieces := []string{}
|
||||
for _key, _value in data {
|
||||
key := urllib.query_escape(_key)
|
||||
value := urllib.query_escape(_value)
|
||||
@ -151,7 +151,7 @@ fn build_url_from_fetch(_url string, config FetchConfig) ?string {
|
||||
if params.keys().len == 0 {
|
||||
return url.str()
|
||||
}
|
||||
mut pieces := []string
|
||||
mut pieces := []string{}
|
||||
for key in params.keys() {
|
||||
pieces << '${key}=${params[key]}'
|
||||
}
|
||||
@ -314,7 +314,7 @@ fn parse_response(resp string) Response {
|
||||
|
||||
fn (req &Request) build_request_headers(method, host_name, path string) string {
|
||||
ua := req.user_agent
|
||||
mut uheaders := []string
|
||||
mut uheaders := []string{}
|
||||
if 'Host' !in req.headers {
|
||||
uheaders << 'Host: $host_name\r\n'
|
||||
}
|
||||
@ -338,7 +338,7 @@ fn (req &Request) build_request_cookies_header() string {
|
||||
if req.cookies.keys().len < 1 {
|
||||
return ''
|
||||
}
|
||||
mut cookie := []string
|
||||
mut cookie := []string{}
|
||||
for key, val in req.cookies {
|
||||
cookie << '$key: $val'
|
||||
}
|
||||
|
Reference in New Issue
Block a user