Coder Social home page Coder Social logo

wnanbei / direwolf Goto Github PK

View Code? Open in Web Editor NEW
43.0 2.0 3.0 1.66 MB

Package direwolf is a convenient and easy to use http client written in Golang.

Home Page: https://wnanbei.github.io/direwolf/

License: MIT License

Go 100.00%
http-client http-requests golang convenient

direwolf's Issues

Post 表单

Post 表单只能设置[string]string
实际情况下有[string]int的情形

Params not work as expected

params := df.NewParams("aa", "bb")

resp, err := df.Get("https://httpbin.org/get?ss=sd",params)

if err != nil {
	return
}

fmt.Println(resp.Text())

return

{
  "args": {
    "ss": "sd?aa=bb"
  }, 
  "headers": {
    "Accept-Encoding": "gzip", 
    "Host": "httpbin.org", 
    "User-Agent": "direwolf - winter is coming"
  }, 
  "origin": "123.103.48.253, 123.103.48.253", 
  "url": "https://httpbin.org/get?ss=sd%3Faa=bb"
}

Seems like Params's bindRequest method not taking into account the fact that there are parameters on the url

read Response.Body failed unexpected EOF

package main

import (
	"fmt"
	dw "github.com/wnanbei/direwolf"
)

func main() {
	url := "https://blog.csdn.net/u013451157/article/details/78719374"
	headers := dw.NewHeaders(
		"User-Agent", "direwolf",
	)
	resp, err := dw.Get(url, headers)
	if  nil !=  err{
		fmt.Println(err)
		return
	}
	//fmt.Println(resp.Text())

	fmt.Println(string(resp.Content()))
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.