client

package
v1.21.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

ulib client unpack data

Example:

package main

import (
	"fmt"

	"github.com/3JoB/ulib/net/client"
	"github.com/go-resty/resty/v2"
)

func main() {
	r, err := resty.New().R().Get("https://example.com/example.json")
	data := client.UnPackData(r.RawResponse).String()
	fmt.Println(data)
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnPackData

func UnPackData(r *http.Response) *update

Decompress the Body package, support gzip, br, zstd, deflate

func UnPackRawFromBrotli added in v1.16.0

func UnPackRawFromBrotli(src io.Reader) *brotli.Reader

func UnPackRawFromDeflate added in v1.16.0

func UnPackRawFromDeflate(src io.Reader) io.ReadCloser

func UnPackRawFromGZip added in v1.16.0

func UnPackRawFromGZip(src io.Reader) (*gzip.Reader, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL