//
// http.Get with params
//
195575
func Get(urlStr string, params map[string]interface{}) (*HttpResponse, error) {
	resp, err := DefaultClient.Get(URLWithParams(urlStr, params).String())
	if err == nil {
		return &HttpResponse{*resp}, nil
	} else {
		CloseResponse(resp)
		return nil, err
	}
}
261282
func (b *HttpRequest) Param(key, value string) *HttpRequest {
	b.params[key] = value
	return b
}
858981
func (m Map) GetParams(name string) (Params, bool) {
	if val, exist := m[name]; exist {
		if par, ok := val.(Params); ok {
			return par, ok
		}

		if par, ok := val.(map[string]interface{}); ok {
			return Map(par), ok
		}
	}

	return nil, false
}
615597
func Get(url string) (string, error) {
	// Init a new HTTP client
	client := &http.Client{}
	return GetWithClient(url, client)
}
236523
func (ps Params) Get(name string) string {
	for _, p := range ps {
		if p.Name == name {
			return p.Value
		}
	}
	return ""
}
1219554
func (api *APIBase) Get(args params.ApplicationGet) (params.ApplicationGetResults, error) {
	return api.getConfig(args, describe)
}
900692
func (r *request) parseParams() {
	text := r.rawParams
	r.rawParams = nil
	for len(text) > 0 {
		keyLen, n := readSize(text)
		if n == 0 {
			return
		}
		text = text[n:]
		valLen, n := readSize(text)
		if n == 0 {
			return
		}
		text = text[n:]
		if int(keyLen)+int(valLen) > len(text) {
			return
		}
		key := readString(text, keyLen)
		text = text[keyLen:]
		val := readString(text, valLen)
		text = text[valLen:]
		r.params[key] = val
	}
}
267539
func (c *Client) Get() *Request {
	return NewRequest(c.httpClient, c.base, "GET", c.version, c.authstring, c.userAgent)
}
1131420
func (c *HTTPClient) Get(url string) (*http.Response, error) {
	var resp *http.Response
	breaker := c.breakerLookup(url)
	err := breaker.Call(func() error {
		aresp, err := c.Client.Get(url)
		resp = aresp
		return err
	}, c.timeout)
	return resp, err
}
811705
func Params(r *http.Request) map[string]string {
	v := r.Context().Value(routeParamsID)
	if v == nil {
		return map[string]string{}
	}
	if v, ok := v.(map[string]string); ok {
		return v
	}
	return map[string]string{}
}
544199
func (r *Request) Get(key string) string {
	return r.QueryValues().Get(key)
}
573111
func (c *Client) Get(url string) (*Response, error) {
	req, err := c.NewRequest("GET", url, nil)

	if err != nil {
		return nil, err
	}

	req = c.Config.AddRequestHeader(req)
	response, err := c.Do(req)

	if err != nil {
		return nil, err
	}

	return response, nil
}
60922
func (c *Client) Get(u string, params url.Values) (*roundtrip.Response, error) {
	return httplib.ConvertResponse(c.Client.Get(context.TODO(), u, params))
}
363498
func HTTPGet(url string, headers [][]string, username, password string) ([]byte, error) {
	client := &http.Client{Transport: &transport}
	req, err := http.NewRequest("GET", url, nil)

	if err != nil {
		return nil, err
	}

	if username != "" && password != "" {
		req.SetBasicAuth(username, password)
	}

	if len(headers) > 0 {
		for i := range headers {
			req.Header.Add(headers[i][0], headers[i][1])
		}
	}
	return makeRequest(client, req)
}
507311
func Get(r *http.Request) *Context {

	// get the context bound to the http.Request
	if v, ok := r.Body.(*wrapper); ok {
		return v.context
	}

	// create a new context
	c := Context{ }
	c.Params = make(Params)
	c.Values = make(Values)
	c.req = r

	// wrap the request and bind the context
	wrapper := wrap(r)
	wrapper.context = &c
	return &c
}
977207
func (r *request) GetQueryParams() url.Values {
	var result = make(url.Values)
	for key, value := range r.query {
		result[key] = append([]string{}, value...)
	}
	return result
}
891504
func GetParam(name string, r *http.Request, index ...int) string {
	if params := r.Context().Value(ParamsKey); params != nil {
		params := params.(Params)
		if name != "*" {
			name = ":" + name
		}
		if param := params[name]; param != nil {
			switch param := param.(type) {
			case []string:
				if len(index) > 0 {
					if index[0] < len(param) {
						return param[index[0]]
					}
					return ""
				}
				return param[0]
			default:
				return param.(string)
			}
		}
	}
	return ""
}