![http client golang http client golang](https://cdn-images-1.medium.com/max/2600/1*jUvITMyDQTTQO2ernU5q9w.png)
Looking further out on the horizon, we decided that we don’t want to constrain what HTTP client or JSON parser you use in order to interact with SendGrid. Since we decided to use Go’s native HTTP client, two questions remain: Why did we make a new repository for the HTTP client separate from the SendGrid client, and why didn’t we use the native types included with the Go HTTP client? Open Source Rest HTTP Client We want the SendGrid client library to be as lean as possible, and also flexible enough to allow us to build on the lean-core using the concept of helpers, where the v3/mail/send endpoint became the first available helper. In the case of the Go client, this was easy since the previous version of the library didn’t have any external dependencies. We took this opportunity to pare down as many external dependencies as we could across all of our libraries.You may wonder why we didn’t use a third party Go HTTP client library. So, we decided to forgo the fluent interface. On Fluent Interfaces and GoĪfter consulting with some resident SendGrid Go hackers, and performing some mighty fine Googling, we found that reflection in Go is too expensive right now. With Python, PHP, C#, and Ruby, we used reflection and method chaining to implement fluent interfaces, making it easy to build the endpoint URLs.
![http client golang http client golang](https://golang.ch/wp-content/uploads/2017/03/68747470733a2f2f646f63732e676f6f676c652e636f6d2f64726177696e67732f642f317035335657787a474e667938726a722d6d5738707669734a6d686b6f4c6c383276416763744f5f366631772f7075623f773d39363026683d373230-768x471.png)
#Http client golang update
To prepare for the new v3/mail/send endpoint, we decided to update our 7 open source client libraries with support for all v3 Web API calls because the previous versions of the libraries were tightly coupled with the v2 mail send endpoint.