// Header returns the value of a response header with given key.
// If no such header is found, an empty string is returned.
969734
func (r *httpVPackResponse) Header(key string) string {
	return r.resp.Header.Get(key)
}
747533
func (r *SearchRequest) header() interface{} {
	h := make(map[string]interface{})
	if r.searchType != "" {
		h["search_type"] = r.searchType
	}

	switch len(r.indices) {
	case 0:
	case 1:
		h["index"] = r.indices[0]
	default:
		h["indices"] = r.indices
	}

	switch len(r.types) {
	case 0:
	case 1:
		h["types"] = r.types[0]
	default:
		h["type"] = r.types
	}

	if r.routing != nil && *r.routing != "" {
		h["routing"] = *r.routing
	}

	if r.preference != nil && *r.preference != "" {
		h["preference"] = *r.preference
	}

	return h
}
789731
func (c *cache) Header(key string) (Header, error) {
	path := headerPrefix + formatPrefix + hashKey(key)
	f, err := c.fs.Open(path)
	if err != nil {
		if vfs.IsNotExist(err) {
			return Header{}, ErrNotFoundInCache
		}
		return Header{}, err
	}

	return readHeaders(bufio.NewReader(f))
}
418045
func (b *HttpRequest) Header(key, value string) *HttpRequest {
	b.req.Header.Set(key, value)
	return b
}
370566
func (c *BotEventsCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}
517277
func (c *Context) Header(name string) string {
	return c.request.Header.Get(name)
}
1044963
func (c *ServerGetBotConfigCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}
958952
func (c *GetConfigByHashCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}
506855
func (h Header) Get(key string) interface{} {
	if h == nil {
		return nil
	}
	return h[key]
}
845334
func (c *PollCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}
83596
func (c *Call) Header(k string) string {
	if c == nil {
		return ""
	}

	if v, ok := c.ic.req.Headers.Get(k); ok {
		return v
	}

	return ""
}
371836
func (r *responseRecorderWithoutCloseNotify) Header() http.Header {
	if r.HeaderMap == nil {
		r.HeaderMap = make(http.Header)
	}

	return r.HeaderMap
}
479484
func (s *ReindexService) Header(name string, value string) *ReindexService {
	if s.headers == nil {
		s.headers = http.Header{}
	}
	s.headers.Add(name, value)
	return s
}
327891
func (c *BotsDimensionsCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}
716937
func (c *GetTaskDefCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}
99603
func Header(headers map[string]string) RequestOption {
	return func(req *http.Request) (*http.Request, error) {
		for k, v := range headers {
			if strings.ToLower(k) == "content-length" {
				if len, err := strconv.Atoi(v); err == nil && req.ContentLength <= 0 {
					req.ContentLength = int64(len)
				}
			} else {
				req.Header.Set(k, v)
			}
		}

		return req, nil
	}
}
617457
func (r *Response) Header(header string) *String {
	value := ""
	if !r.chain.failed() {
		value = r.resp.Header.Get(header)
	}
	return &String{r.chain, value}
}