summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/monaco-io/request/model.go
diff options
context:
space:
mode:
authorGary Kim <gary@garykim.dev>2020-07-18 22:08:25 +0800
committerGitHub <noreply@github.com>2020-07-18 16:08:25 +0200
commit71a5b72aff5159f3066ff100e1510d935ebdff85 (patch)
treef940bc6e7aa86e1ca818929fb4c2917983a32177 /vendor/github.com/monaco-io/request/model.go
parent213bf349c319811c8cb5458ac24ad9e61c5bbe4d (diff)
downloadmatterbridge-msglm-71a5b72aff5159f3066ff100e1510d935ebdff85.tar.gz
matterbridge-msglm-71a5b72aff5159f3066ff100e1510d935ebdff85.tar.bz2
matterbridge-msglm-71a5b72aff5159f3066ff100e1510d935ebdff85.zip
Add Nextcloud Talk support (#1167)
Signed-off-by: Gary Kim <gary@garykim.dev>
Diffstat (limited to 'vendor/github.com/monaco-io/request/model.go')
-rw-r--r--vendor/github.com/monaco-io/request/model.go66
1 files changed, 66 insertions, 0 deletions
diff --git a/vendor/github.com/monaco-io/request/model.go b/vendor/github.com/monaco-io/request/model.go
new file mode 100644
index 00000000..6dd58bca
--- /dev/null
+++ b/vendor/github.com/monaco-io/request/model.go
@@ -0,0 +1,66 @@
+package request
+
+import (
+ "net/http"
+ "time"
+)
+
+const (
+ // ApplicationJSON application/json
+ ApplicationJSON ContentType = "application/json"
+
+ // ApplicationXWwwFormURLEncoded application/x-www-form-urlencoded
+ ApplicationXWwwFormURLEncoded ContentType = "application/x-www-form-urlencoded"
+
+ // MultipartFormData multipart/form-data
+ MultipartFormData ContentType = "multipart/form-data"
+)
+
+// ContentType Content-Type
+type ContentType string
+
+// Client Method
+/*
+ Method = "OPTIONS" ; Section 9.2
+ | "GET" ; Section 9.3
+ | "HEAD" ; Section 9.4
+ | "POST" ; Section 9.5
+ | "PUT" ; Section 9.6
+ | "DELETE" ; Section 9.7
+ | "TRACE" ; Section 9.8
+ | "CONNECT" ; Section 9.9
+ | extension-method
+ extension-method = token
+ token = 1*<any CHAR except CTLs or separators>
+*/
+type Client struct {
+ URL string
+ Method string
+ Header map[string]string
+ Params map[string]string
+ Body []byte
+ BasicAuth BasicAuth
+ Timeout time.Duration // second
+ ProxyURL string
+ ContentType ContentType
+ Cookies []*http.Cookie
+
+ // private
+ client *http.Client
+ req *http.Request
+}
+
+// BasicAuth Add Username:Password as Basic Auth
+type BasicAuth struct {
+ Username string
+ Password string
+}
+
+// SugaredResp Sugared response with status code and body data
+type SugaredResp struct {
+ Data []byte
+ Code int
+
+ // private
+ resp *http.Response
+}