1
0
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:
yuyi
2020-04-26 19:49:31 +08:00
committed by GitHub
parent 7b39ab6d06
commit 9f4d498ff1
59 changed files with 181 additions and 254 deletions

View File

@ -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:

View File

@ -1,7 +1,5 @@
import (
net.http
time
)
import net.http
import time
struct SetCookieTestCase {
cookie &http.Cookie

View File

@ -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'
}