All Projects → monaco-io → Request

monaco-io / Request

Licence: mit
go request, go http client

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Request

electron-request
Zero-dependency, Lightweight HTTP request client for Electron or Node.js
Stars: ✭ 45 (-57.14%)
Mutual labels:  client, request, net
go-axios
HTTP Request package for golang.
Stars: ✭ 29 (-72.38%)
Mutual labels:  axios, request
vue-methods-promise
Let Vue methods support return Promise
Stars: ✭ 35 (-66.67%)
Mutual labels:  axios, request
Netcat
💻 Netcat client and server modules written in pure Javascript for Node.js.
Stars: ✭ 315 (+200%)
Mutual labels:  net, client
miniprogram-network
Redefine the Network API of Wechat MiniProgram (小程序网络库)
Stars: ✭ 93 (-11.43%)
Mutual labels:  axios, request
gists
Methods for working with the GitHub Gist API. Node.js/JavaScript
Stars: ✭ 96 (-8.57%)
Mutual labels:  axios, request
axios-for-observable
A RxJS wrapper for axios, same api as axios absolutely
Stars: ✭ 13 (-87.62%)
Mutual labels:  axios, request
Vue Api Request
Control your API calls by using an amazing component which supports axios and vue-resource
Stars: ✭ 116 (+10.48%)
Mutual labels:  axios, request
Aliyun Openapi Net Sdk
Alibaba Cloud SDK for .NET
Stars: ✭ 467 (+344.76%)
Mutual labels:  net, client
Guzzlette
🌀 Guzzle integration into Nette Framework (@nette)
Stars: ✭ 19 (-81.9%)
Mutual labels:  request, client
Axios Module
Secure and easy axios integration with Nuxt.js
Stars: ✭ 998 (+850.48%)
Mutual labels:  axios, request
Github Ranking
🔍GitHub不同语言热门项目排行,Vue.js做页面展示
Stars: ✭ 160 (+52.38%)
Mutual labels:  axios, request
Wechat Request
🚀⚡️基于Promise实现微信小程序http请求,轻便,小巧,api友好,功能丰富
Stars: ✭ 156 (+48.57%)
Mutual labels:  axios, request
github-base
Simple, opinionated node.js interface for creating basic apps with the GitHub API.
Stars: ✭ 58 (-44.76%)
Mutual labels:  axios, request
Rxios
A RxJS wrapper for axios
Stars: ✭ 119 (+13.33%)
Mutual labels:  axios, request
Webdav Fs
Node fs wrapper for WebDAV
Stars: ✭ 72 (-31.43%)
Mutual labels:  request, client
Restrequest4delphi
API to consume REST services written in any programming language with support to Lazarus and Delphi
Stars: ✭ 162 (+54.29%)
Mutual labels:  request, client
Bitcoin Core
A modern Bitcoin Core REST and RPC client.
Stars: ✭ 379 (+260.95%)
Mutual labels:  request, client
Frisbee
🐕 Modern fetch-based alternative to axios/superagent/request. Great for React Native.
Stars: ✭ 1,038 (+888.57%)
Mutual labels:  axios, request
Influxdb.client
InfluxDB Client for .NET
Stars: ✭ 94 (-10.48%)
Mutual labels:  net, client

Request Mentioned in Awesome Go Go Report Card Go

GoDoc codecov Release TODOs License

HTTP Client for golang, Inspired by Javascript-axios Python-request. If you have experience about axios or requests, you will love it. No 3rd dependency.

Features

  • Make http requests from Golang
  • Transform request and response data

Installing

go mod:

go get github.com/monaco-io/request

Methods

  • OPTIONS
  • GET
  • HEAD
  • POST
  • PUT
  • DELETE
  • TRACE
  • CONNECT

Example

POST

package main

import (
    "github.com/monaco-io/request"
)

func main() {
    var body = struct {
         A string
         B int
        }{A: "A", B: 1}
    var result interface{}

    c := request.Client{
        URL:    "https://google.com",
        Method: "POST",
        Query: map[string]string{"hello": "world"},
        JSON:   body,
    }
    resp := c.Send().Scan(&result)
    if !resp.OK(){
        // handle error
        log.Println(resp.Error())
    }

    // str := resp.String()
    // bytes := resp.Bytes()

POST with local files

package main

import (
    "github.com/monaco-io/request"
)

func main() {
    c := request.Client{
        URL:    "https://google.com",
        Method: "POST",
        Query: map[string]string{"hello": "world"},
        MultipartForm: MultipartForm{
            Fields: map[string]string{"a": "1"},
			Files:  []string{"doc.txt"},
        },
    }
    resp := c.Send().Scan(&result)
    ...

POST step by step

package main

import (
    "github.com/monaco-io/request"
)

func main() {
    var response interface{}

    resp := request.
        New().
        POST("http://httpbin.org/post").
        AddHeader(map[string]string{"Google": "google"}).
        AddBasicAuth("google", "google").
        AddURLEncodedForm(map[string]string{"data": "google"}).
        Send().
        Scan(&response)
    ...

Authorization

package main

import (
    "github.com/monaco-io/request"
)

func main() {
    c := request.Client{
        URL:       "https://google.com",
        Method:    "POST",
        BasicAuth: request.BasicAuth{
            Username: "google",
            Password: "google",
        },
    }
    resp := c.Send()
}

Timeout

package main

import (
    "github.com/monaco-io/request"
)

func main() {
    c := request.Client{
        URL:       "https://google.com",
        Method:    "POST",
        Timeout:   time.Second*10,
    }
}

Cookies

package main

import (
    "github.com/monaco-io/request"
)

func main() {
    c := request.Client{
        URL:       "https://google.com",
        CookiesMap: map[string]string{
            "cookie_name": "cookie_value",
        }
    }
}

TLS

package main

import (

    "github.com/monaco-io/request"
)

func main() {
    c := request.Client{
        URL:       "https://google.com",
        TLSConfig: &tls.Config{InsecureSkipVerify: true},
    }
}

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].