Skip to content

Latest commit

 

History

History
118 lines (99 loc) · 3.9 KB

_index.md

File metadata and controls

118 lines (99 loc) · 3.9 KB
title type
Welcome
docs

Simple HTTP, REST, and SSE client library for Go

Resty Build Status Resty Code Coverage Go Report Card Resty GoDoc Mentioned in Awesome Go

require resty.dev/v3 {{% param Resty.V3.Version %}}
Minimum required Go version is {{% param Resty.V3.GoMinVersion %}}

{{% columns %}}

// HTTP, REST Client
client := resty.New()
defer client.Close()

res, err := client.R().
    EnableTrace().
    Get("https://httpbin.org/get")
fmt.Println(err, res)
fmt.Println(res.Request.TraceInfo())

<--->

// Server-Sent Events Client
es := NewEventSource().
    SetURL("https://sse.dev/test").
    OnMessage(func(e any) {
        fmt.Println(e.(*resty.Event))
    }, nil)

err := es.Get()
fmt.Println(err)

{{% /columns %}}

Resty v3 offers improved performance, memory efficiency, and features compared to Resty v2.

This website represents Resty v3 and above. For previous v2 documentation, refer to this [README.md]({{% param Resty.GitHubRepo %}}/blob/v2/README.md "Resty v2 README")

Key Features

{{% columns %}}

  • Simple and chainable methods
  • Multipart and Form data with ease
  • Request Path Params
  • Retry Mechanism
  • Circuit Breaker
  • Goroutine & concurrent safe
  • Automatic decompresser (gzip, deflate)
  • Basic auth, Digest auth, Bearer, etc.
  • Request tracing
  • CURL command generation
  • HTTP/1.1 and HTTP/2. Integrate HTTP/3

and much more ...

<--->

  • Automatic marshal and unmarshal
  • Large file upload and progress callback
  • Download to file
  • Redirect Policies
  • Circuit Breaker Policy
  • Debug mode with human-readable, JSON log
  • Load Balancer and Service Discovery
  • Response body limit & Unlimited reads
  • Bazel support
  • Dynamic reload of TLS certificates
  • Custom root and client certificates

and much more ...

{{% /columns %}}

Highly Extensible

Resty provides various ways to enhance its functionality by implementing its interfaces to meet all custom requirements.

  • Request middleware
  • Response middleware
  • Content-Type encoder & decoder
  • Content Decompresser
  • Load Balancer and Service Discovery
  • Retry Strategy, Condition, and Hooks
  • Circuit Breaker Policy
  • Request Functions
  • Redirect Policy
  • Transport RoundTripper
  • Debug Log Formatter
  • Logger