{"id":331,"date":"2026-05-07T09:00:00","date_gmt":"2026-05-07T03:30:00","guid":{"rendered":"https:\/\/smitabharat.com\/blog\/go-http-client-guide\/"},"modified":"2026-10-10T21:21:13","modified_gmt":"2026-10-10T15:51:13","slug":"go-http-client-guide","status":"publish","type":"post","link":"https:\/\/smitabharat.com\/blog\/go-http-client-guide\/","title":{"rendered":"Go HTTP Client Explained for Beginners"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The Go HTTP client lets your program call other web services, such as a payment API or a weather service. In this post, you will send GET and POST requests, decode JSON and add headers. You will also set timeouts and handle errors safely.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So far, you built servers in <a href=\"https:\/\/smitabharat.com\/blog\/go-rest-api-tutorial\/\">the Go REST API tutorial<\/a>. Now your code becomes the caller. We also decode responses with the tools from <a href=\"https:\/\/smitabharat.com\/blog\/go-json-encoding-decoding\/\">Go JSON encoding and decoding<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What Is the Go HTTP Client?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>net\/http<\/code> package includes both a server and a client. In short, the client sends a request and waits for the reply. Then it gives you an <code>*http.Response<\/code> with a status, headers and a body.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Think of ordering food by phone. First, you dial the number and say what you want. Then you wait, and finally the restaurant answers with your order or an apology. Similarly, a request goes out, and a response comes back.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Always Create a Client with a Timeout<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>client := &amp;http.Client{Timeout: 2 * time.Second}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The quick helper <code>http.Get<\/code> uses the default client, which has no timeout at all. Therefore, one slow server could make your program wait forever. So create your own Go HTTP client once and set a timeout. Also reuse it everywhere, because it keeps connections open for speed.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Sending a GET Request with the Go HTTP Client<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>resp, err := client.Get(baseURL + \"\/books\/1\")\nif err != nil {\n\treturn err\n}\ndefer resp.Body.Close()\n\nif resp.StatusCode != http.StatusOK {\n\treturn fmt.Errorf(\"unexpected status: %s\", resp.Status)\n}\n\nvar book Book\nif err := json.NewDecoder(resp.Body).Decode(&amp;book); err != nil {\n\treturn err\n}\nfmt.Printf(\"%+v\\n\", book) \/\/ {ID:1 Title:Go Basics Author:Asha}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">There are three checks here, and each one matters. First, <code>err<\/code> reports network problems. Next, the status code reports problems on the server side. Finally, the decoder reports bad JSON.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The diagram below shows the full round trip.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-http-client-guide-diagram-1024x640.png\" alt=\"Go HTTP Client diagram showing a request and response round trip followed by error, status and JSON checks\" class=\"wp-image-325\" srcset=\"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-http-client-guide-diagram-1024x640.png 1024w, https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-http-client-guide-diagram-300x188.png 300w, https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-http-client-guide-diagram-768x480.png 768w, https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-http-client-guide-diagram-1536x960.png 1536w, https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-http-client-guide-diagram-2048x1280.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><em>The client sends a request, the server replies with a status and a body, and your code checks the error, the status and the JSON in that order.<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">A 404 Is Not an Error<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>resp, _ := client.Get(baseURL + \"\/missing\")\nresp.Body.Close()\nfmt.Println(resp.StatusCode, resp.Status) \/\/ 404 404 Not Found<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This surprises many beginners. The Go HTTP client only returns an error when the request itself fails, such as a refused connection. A 404 or 500 is still a valid answer, so you must check <code>StatusCode<\/code> yourself.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Sending JSON with POST<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>body, _ := json.Marshal(Book{Title: \"Go Testing\", Author: \"Ravi\"})\nresp, err := client.Post(baseURL+\"\/books\", \"application\/json\", bytes.NewReader(body))\nif err != nil {\n\treturn err\n}\ndefer resp.Body.Close()\n\nvar created Book\njson.NewDecoder(resp.Body).Decode(&amp;created)\nfmt.Println(resp.Status, created.ID, created.Title) \/\/ 201 Created 2 Go Testing<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><code>Post<\/code> takes the URL, the content type and a body reader. Here <code>bytes.NewReader<\/code> turns our JSON bytes into that reader. Also, the server answered with 201 Created, which is the usual status for a new record. So in real code, check for <code>http.StatusCreated<\/code> rather than 200 after a POST.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Custom Headers and Context with NewRequest<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\ndefer cancel()\n\nreq, err := http.NewRequestWithContext(ctx, \"GET\", baseURL+\"\/auth\", nil)\nif err != nil {\n\treturn err\n}\nreq.Header.Set(\"Authorization\", \"Bearer abc123\")\n\nresp, err := client.Do(req)<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For anything beyond a simple call, build the request yourself. Then you can add headers such as an API token and attach a context. As a result, the call stops early when the user cancels, just like in <a href=\"https:\/\/smitabharat.com\/blog\/go-context-beginners-guide\/\">Go context for beginners<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Go HTTP Client Errors You Will See<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>Get \"http:\/\/127.0.0.1:PORT\/slow\": context deadline exceeded (Client.Timeout exceeded while awaiting headers)\nGet \"http:\/\/127.0.0.1:PORT\/slow\": context deadline exceeded\nGet \"http:\/\/localhost:1\/x\": dial tcp 127.0.0.1:1: connect: connection refused<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The first line comes from the client timeout, while the second comes from a context deadline. Meanwhile, the third means nothing is listening on that port. We produced all three against a local test server.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Common Mistakes with the Go HTTP Client<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Problem you see<\/th><th>Why it happens<\/th><th>How to fix it<\/th><\/tr><\/thead><tbody><tr><td>Program hangs on a slow API<\/td><td>Because <code>http.Get<\/code> has no timeout.<\/td><td>So create a client with <code>Timeout<\/code>.<\/td><\/tr><tr><td>Too many open connections<\/td><td>Because the body was never closed.<\/td><td>So always <code>defer resp.Body.Close()<\/code>.<\/td><\/tr><tr><td>404 treated as success<\/td><td>Because only <code>err<\/code> was checked.<\/td><td>So check <code>resp.StatusCode<\/code> too.<\/td><\/tr><tr><td>Nil pointer panic on resp<\/td><td>Because <code>resp<\/code> was used when <code>err<\/code> was not nil.<\/td><td>So return early on any error.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">API client questions are popular in backend interviews. So practise with my <a href=\"https:\/\/smitabharat.com\/blog\/go-lang-interview-questions-and-answers\/\">Go interview questions and answers<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Official Resources<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">These pages come straight from the Go team, so they stay accurate and up to date.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/pkg.go.dev\/net\/http#Client\">net\/http package documentation<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/pkg.go.dev\/net\/http#NewRequestWithContext\">net\/http: NewRequestWithContext<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Quick Recap<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The Go HTTP client lives in <code>net\/http<\/code> next to the server.<\/li>\n\n\n\n<li>Create one client with a timeout and reuse it.<\/li>\n\n\n\n<li>Check the error, then the status code, then decode the body.<\/li>\n\n\n\n<li>Always close the response body with <code>defer<\/code>.<\/li>\n\n\n\n<li>Use <code>NewRequestWithContext<\/code> for headers and cancellation.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">What&#8217;s Next?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Your code can now talk to other services. Next, we will test that code without calling the real services by using interfaces and mocks.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Next lesson: <a href=\"https:\/\/smitabharat.com\/blog\/go-mocking-interfaces-testing\/\">Go Mocking with Interfaces for Unit Tests<\/a><\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>The Go HTTP client lets your program call other web services, such as a payment API or a weather service. In this post, you&hellip;<\/p>\n","protected":false},"author":1,"featured_media":324,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_swapz_level":"","_swapz_series_part":0,"_swapz_hide_toc":false,"_swapz_hide_featured":false,"_swapz_description":"","footnotes":""},"categories":[15],"tags":[64,11,23,21],"swapz_series":[],"class_list":["post-331","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-go-lang","tag-go-http-client","tag-go-lang","tag-go-tutorial","tag-golang-basics"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Go HTTP Client Explained for Beginners with Examples<\/title>\n<meta name=\"description\" content=\"Learn the Go HTTP client with simple examples: GET and POST JSON, set timeouts and headers, check status codes and always close the body.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/smitabharat.com\/blog\/go-http-client-guide\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Go HTTP Client Explained for Beginners with Examples\" \/>\n<meta property=\"og:description\" content=\"Learn the Go HTTP client with simple examples: GET and POST JSON, set timeouts and headers, check status codes and always close the body.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/smitabharat.com\/blog\/go-http-client-guide\/\" \/>\n<meta property=\"og:site_name\" content=\"Smita Bharat - Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-05-07T03:30:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-10-10T15:51:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-http-client-guide-featured.png\" \/>\n\t<meta property=\"og:image:width\" content=\"2400\" \/>\n\t<meta property=\"og:image:height\" content=\"1260\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Smita\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Smita\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-http-client-guide\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-http-client-guide\\\/\"},\"author\":{\"name\":\"Smita\",\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/#\\\/schema\\\/person\\\/27a1b1067d396703215c54acedbfd339\"},\"headline\":\"Go HTTP Client Explained for Beginners\",\"datePublished\":\"2026-05-07T03:30:00+00:00\",\"dateModified\":\"2026-10-10T15:51:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-http-client-guide\\\/\"},\"wordCount\":656,\"publisher\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/#\\\/schema\\\/person\\\/27a1b1067d396703215c54acedbfd339\"},\"image\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-http-client-guide\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/10\\\/go-http-client-guide-featured.png\",\"keywords\":[\"Go HTTP Client\",\"Go Lang\",\"Go Tutorial\",\"Golang Basics\"],\"articleSection\":[\"Go Lang\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-http-client-guide\\\/\",\"url\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-http-client-guide\\\/\",\"name\":\"Go HTTP Client Explained for Beginners with Examples\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-http-client-guide\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-http-client-guide\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/10\\\/go-http-client-guide-featured.png\",\"datePublished\":\"2026-05-07T03:30:00+00:00\",\"dateModified\":\"2026-10-10T15:51:13+00:00\",\"description\":\"Learn the Go HTTP client with simple examples: GET and POST JSON, set timeouts and headers, check status codes and always close the body.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-http-client-guide\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-http-client-guide\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-http-client-guide\\\/#primaryimage\",\"url\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/10\\\/go-http-client-guide-featured.png\",\"contentUrl\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/10\\\/go-http-client-guide-featured.png\",\"width\":2400,\"height\":1260,\"caption\":\"Go HTTP Client featured image: cards for GET, POST and timeouts\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-http-client-guide\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Go HTTP Client Explained for Beginners\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/\",\"name\":\"Smita Bharat Blog\",\"description\":\"Golang &amp; Backend Development Tutorials and Interview Questions\",\"publisher\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/#\\\/schema\\\/person\\\/27a1b1067d396703215c54acedbfd339\"},\"alternateName\":\"Smita Bharat\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/#\\\/schema\\\/person\\\/27a1b1067d396703215c54acedbfd339\",\"name\":\"Smita\",\"logo\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/#\\\/schema\\\/person\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/smitabharat.com\\\/blog\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Go HTTP Client Explained for Beginners with Examples","description":"Learn the Go HTTP client with simple examples: GET and POST JSON, set timeouts and headers, check status codes and always close the body.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/smitabharat.com\/blog\/go-http-client-guide\/","og_locale":"en_US","og_type":"article","og_title":"Go HTTP Client Explained for Beginners with Examples","og_description":"Learn the Go HTTP client with simple examples: GET and POST JSON, set timeouts and headers, check status codes and always close the body.","og_url":"https:\/\/smitabharat.com\/blog\/go-http-client-guide\/","og_site_name":"Smita Bharat - Blog","article_published_time":"2026-05-07T03:30:00+00:00","article_modified_time":"2026-10-10T15:51:13+00:00","og_image":[{"width":2400,"height":1260,"url":"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-http-client-guide-featured.png","type":"image\/png"}],"author":"Smita","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Smita","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/smitabharat.com\/blog\/go-http-client-guide\/#article","isPartOf":{"@id":"https:\/\/smitabharat.com\/blog\/go-http-client-guide\/"},"author":{"name":"Smita","@id":"https:\/\/smitabharat.com\/blog\/#\/schema\/person\/27a1b1067d396703215c54acedbfd339"},"headline":"Go HTTP Client Explained for Beginners","datePublished":"2026-05-07T03:30:00+00:00","dateModified":"2026-10-10T15:51:13+00:00","mainEntityOfPage":{"@id":"https:\/\/smitabharat.com\/blog\/go-http-client-guide\/"},"wordCount":656,"publisher":{"@id":"https:\/\/smitabharat.com\/blog\/#\/schema\/person\/27a1b1067d396703215c54acedbfd339"},"image":{"@id":"https:\/\/smitabharat.com\/blog\/go-http-client-guide\/#primaryimage"},"thumbnailUrl":"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-http-client-guide-featured.png","keywords":["Go HTTP Client","Go Lang","Go Tutorial","Golang Basics"],"articleSection":["Go Lang"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/smitabharat.com\/blog\/go-http-client-guide\/","url":"https:\/\/smitabharat.com\/blog\/go-http-client-guide\/","name":"Go HTTP Client Explained for Beginners with Examples","isPartOf":{"@id":"https:\/\/smitabharat.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/smitabharat.com\/blog\/go-http-client-guide\/#primaryimage"},"image":{"@id":"https:\/\/smitabharat.com\/blog\/go-http-client-guide\/#primaryimage"},"thumbnailUrl":"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-http-client-guide-featured.png","datePublished":"2026-05-07T03:30:00+00:00","dateModified":"2026-10-10T15:51:13+00:00","description":"Learn the Go HTTP client with simple examples: GET and POST JSON, set timeouts and headers, check status codes and always close the body.","breadcrumb":{"@id":"https:\/\/smitabharat.com\/blog\/go-http-client-guide\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/smitabharat.com\/blog\/go-http-client-guide\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/smitabharat.com\/blog\/go-http-client-guide\/#primaryimage","url":"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-http-client-guide-featured.png","contentUrl":"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-http-client-guide-featured.png","width":2400,"height":1260,"caption":"Go HTTP Client featured image: cards for GET, POST and timeouts"},{"@type":"BreadcrumbList","@id":"https:\/\/smitabharat.com\/blog\/go-http-client-guide\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/smitabharat.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Go HTTP Client Explained for Beginners"}]},{"@type":"WebSite","@id":"https:\/\/smitabharat.com\/blog\/#website","url":"https:\/\/smitabharat.com\/blog\/","name":"Smita Bharat Blog","description":"Golang &amp; Backend Development Tutorials and Interview Questions","publisher":{"@id":"https:\/\/smitabharat.com\/blog\/#\/schema\/person\/27a1b1067d396703215c54acedbfd339"},"alternateName":"Smita Bharat","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/smitabharat.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/smitabharat.com\/blog\/#\/schema\/person\/27a1b1067d396703215c54acedbfd339","name":"Smita","logo":{"@id":"https:\/\/smitabharat.com\/blog\/#\/schema\/person\/image\/"},"sameAs":["https:\/\/smitabharat.com\/blog"]}]}},"_links":{"self":[{"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/posts\/331","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/comments?post=331"}],"version-history":[{"count":2,"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/posts\/331\/revisions"}],"predecessor-version":[{"id":338,"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/posts\/331\/revisions\/338"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/media\/324"}],"wp:attachment":[{"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/media?parent=331"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/categories?post=331"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/tags?post=331"},{"taxonomy":"swapz_series","embeddable":true,"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/swapz_series?post=331"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}