zoukankan      html  css  js  c++  java
  • go ghttp 配置代理 配置header

    package main
    
    import (
    	"github.com/gogf/gf/net/ghttp"
    	"net/http"
    	"net/url"
    	"time"
    )
    
    func main() {
    	
    	task := ghttp.NewClient()
    	urli := url.URL{}
    	urlproxy, _ := urli.Parse("http://127.0.0.1:8080")
    	task.Transport = &http.Transport{
    		Proxy: http.ProxyURL(urlproxy),
    	}
    	task.SetTimeOut(time.Second * 15)
    	task.Get("http://www.baidu.com")
    
    }
    

      

     
  • 相关阅读:
    每日总结
    每日总结
    每日总结
    每日总结
    每周总结
    每日总结
    10.20
    10.19
    10.18
    10.17
  • 原文地址:https://www.cnblogs.com/yakoazz/p/12207268.html
Copyright © 2011-2022 走看看