Git Product home page Git Product logo

httpreq's People

Contributors

bariscanyilmaz avatar gozeloglu avatar msrexe avatar muratmirgun avatar recep avatar yakuter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

httpreq's Issues

Support proxy

We need to support proxy usage. To do this we need a method like SetProxy(url string). The url should contain both address and port like http://proxy.com:23456. Then this method will set the proxy to the request.

Support query parameters

We need to support query parameters. To do this we need a method like SetParam(params map[string]interface{}). Then this method will add the keys and values as query parameters to the requests.

Support cookies

We need cookie support. To do this we should have a method like SetCookie(*http.Cookie). Then this method will add the cookie to the request.

Add context to request.

We need context.Context to interrupt request. To do this, we should create new request like New(ctx, address). Then we shoud create request with this context.

Support XML

httpreq has only JSON support for now. However we should also support XML. To do this we need to;

  1. add XML header application/xml; charset=UTF-8 to request header
  2. create a method like SetBodyXML to set our request body as XML.

Configurable transport

Golang http clients has transport layer. So our transport layer should be configurable from outside. To achieve this we need a SetTransport helper as in the example. Then this method overwrites our request's transport (r.client.Transport)

transport := &http.Transport{
	// ...
}

req.SetTransport(transport)

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.