File size: 651 Bytes
6bc074c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package httpclient

import (
	"io"
	"net/http"
)

type AuroraHttpClient interface {
	Request(method HttpMethod, url string, headers AuroraHeaders, cookies []*http.Cookie, body io.Reader) (*http.Response, error)
	SetProxy(url string) error
	SetCookies(rawUrl string, cookies []*http.Cookie)
	GetCookies(rawUrl string) []*http.Cookie
}

type HttpMethod string

const (
	GET     HttpMethod = "GET"
	POST    HttpMethod = "POST"
	PUT     HttpMethod = "PUT"
	HEAD    HttpMethod = "HEAD"
	DELETE  HttpMethod = "DELETE"
	OPTIONS HttpMethod = "OPTIONS"
)

type AuroraHeaders map[string]string

func (a AuroraHeaders) Set(key, value string) {
	a[key] = value
}