axios

package module
v0.0.0-...-d94cd94 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: MIT Imports: 4 Imported by: 0

README

Axios

⚡️ Quickstart

package main

import "fmt"
import "github.com/ichbinbekir/axios"

func main() {

  response, err := axios.Get("http://example.com", axios.AxiosRequestConfig{Headers: map[string]string{"hello": "hello"}})
  if err != nil {
    panic(err)
  }
  
  fmt.Println(response.Data)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AxiosRequestConfig

type AxiosRequestConfig struct {
	Method  string
	Url     string
	Headers map[string]string
	Data    any
}

type AxiosResponse

type AxiosResponse struct {
	Status     int
	StatusText string
	Headers    map[string]string
	Data       any
}

func Get

func Get(url string, config AxiosRequestConfig) (*AxiosResponse, error)

func Post

func Post(url string, data any, config AxiosRequestConfig) (*AxiosResponse, error)

func Request

func Request(config AxiosRequestConfig) (*AxiosResponse, error)

Jump to

Keyboard shortcuts

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