@@ -10,26 +10,27 @@ import (
1010)
1111
1212type HTTP struct {
13- Title string `json:"title,omitempty" yaml:"title,omitempty"`
14- Meta meta `json:"meta,omitempty" yaml:"meta,omitempty"`
15- id string `json:"-" yaml:"-"`
16- URL string `json:"url,omitempty" yaml:"url,omitempty"`
17- Method string `json:"method,omitempty" yaml:"method,omitempty"`
18- Status matcher `json:"status" yaml:"status"`
19- AllowInsecure bool `json:"allow-insecure" yaml:"allow-insecure"`
20- NoFollowRedirects bool `json:"no-follow-redirects" yaml:"no-follow-redirects"`
21- Timeout int `json:"timeout,omitempty" yaml:"timeout,omitempty"`
22- RequestHeader []string `json:"request-headers,omitempty" yaml:"request-headers,omitempty"`
23- RequestBody string `json:"request-body,omitempty" yaml:"request-body,omitempty"`
24- Headers matcher `json:"headers,omitempty" yaml:"headers,omitempty"`
25- Body matcher `json:"body,omitempty" yaml:"body,omitempty"`
26- Username string `json:"username,omitempty" yaml:"username,omitempty"`
27- Password string `json:"password,omitempty" yaml:"password,omitempty"`
28- CAFile string `json:"ca-file,omitempty" yaml:"ca-file,omitempty"`
29- CertFile string `json:"cert-file,omitempty" yaml:"cert-file,omitempty"`
30- KeyFile string `json:"key-file,omitempty" yaml:"key-file,omitempty"`
31- Skip bool `json:"skip,omitempty" yaml:"skip,omitempty"`
32- Proxy string `json:"proxy,omitempty" yaml:"proxy,omitempty"`
13+ Title string `json:"title,omitempty" yaml:"title,omitempty"`
14+ Meta meta `json:"meta,omitempty" yaml:"meta,omitempty"`
15+ id string `json:"-" yaml:"-"`
16+ URL string `json:"url,omitempty" yaml:"url,omitempty"`
17+ Method string `json:"method,omitempty" yaml:"method,omitempty"`
18+ Status matcher `json:"status" yaml:"status"`
19+ AllowInsecure bool `json:"allow-insecure" yaml:"allow-insecure"`
20+ NoFollowRedirects bool `json:"no-follow-redirects" yaml:"no-follow-redirects"`
21+ Timeout int `json:"timeout,omitempty" yaml:"timeout,omitempty"`
22+ RequestHeader []string `json:"request-headers,omitempty" yaml:"request-headers,omitempty"`
23+ RequestBody string `json:"request-body,omitempty" yaml:"request-body,omitempty"`
24+ RequestQueryParams map [string ]string `json:"request-query-params,omitempty" yaml:"request-query-params,omitempty"`
25+ Headers matcher `json:"headers,omitempty" yaml:"headers,omitempty"`
26+ Body matcher `json:"body,omitempty" yaml:"body,omitempty"`
27+ Username string `json:"username,omitempty" yaml:"username,omitempty"`
28+ Password string `json:"password,omitempty" yaml:"password,omitempty"`
29+ CAFile string `json:"ca-file,omitempty" yaml:"ca-file,omitempty"`
30+ CertFile string `json:"cert-file,omitempty" yaml:"cert-file,omitempty"`
31+ KeyFile string `json:"key-file,omitempty" yaml:"key-file,omitempty"`
32+ Skip bool `json:"skip,omitempty" yaml:"skip,omitempty"`
33+ Proxy string `json:"proxy,omitempty" yaml:"proxy,omitempty"`
3334}
3435
3536const (
@@ -75,7 +76,7 @@ func (u *HTTP) Validate(sys *system.System) []TestResult {
7576 KeyFile : u .KeyFile ,
7677 NoFollowRedirects : u .NoFollowRedirects ,
7778 Timeout : time .Duration (u .Timeout ) * time .Millisecond , Username : u .Username , Password : u .Password , Proxy : u .Proxy ,
78- RequestHeader : u .RequestHeader , RequestBody : u .RequestBody , Method : u .Method })
79+ RequestHeader : u .RequestHeader , RequestBody : u .RequestBody , RequestQueryParams : u . RequestQueryParams , Method : u .Method })
7980 sysHTTP .SetAllowInsecure (u .AllowInsecure )
8081 sysHTTP .SetNoFollowRedirects (u .NoFollowRedirects )
8182
@@ -98,17 +99,18 @@ func NewHTTP(sysHTTP system.HTTP, config util.Config) (*HTTP, error) {
9899 http := sysHTTP .HTTP ()
99100 status , err := sysHTTP .Status ()
100101 u := & HTTP {
101- id : http ,
102- Status : status ,
103- RequestHeader : []string {},
104- Headers : nil ,
105- Body : []string {},
106- AllowInsecure : config .AllowInsecure ,
107- NoFollowRedirects : config .NoFollowRedirects ,
108- Timeout : config .TimeOutMilliSeconds (),
109- Username : config .Username ,
110- Password : config .Password ,
111- Proxy : config .Proxy ,
102+ id : http ,
103+ Status : status ,
104+ RequestHeader : []string {},
105+ RequestQueryParams : nil ,
106+ Headers : nil ,
107+ Body : []string {},
108+ AllowInsecure : config .AllowInsecure ,
109+ NoFollowRedirects : config .NoFollowRedirects ,
110+ Timeout : config .TimeOutMilliSeconds (),
111+ Username : config .Username ,
112+ Password : config .Password ,
113+ Proxy : config .Proxy ,
112114 }
113115 return u , err
114116}
0 commit comments