{"version":3,"sources":["webpack:///./src/assets/images/create_gist_documentation.png","webpack:///./src/assets/images/authentification_github_api_doc.png","webpack:///./src/assets/images/delete_gist_documentation.png","webpack:///./src/views/Chap35BuildAnHttpClient.vue?b309","webpack:///src/views/Chap35BuildAnHttpClient.vue","webpack:///./src/views/Chap35BuildAnHttpClient.vue?886a","webpack:///./src/views/Chap35BuildAnHttpClient.vue","webpack:///./src/assets/images/github_new_token.png","webpack:///./src/assets/images/create_gist_scope.png","webpack:///./src/assets/images/gist_updated.png","webpack:///./src/assets/images/gist_created.png","webpack:///./src/assets/images/client_server.png","webpack:///./src/assets/images/edit_a_gist.png","webpack:///./src/assets/images/github_personnal_token.png"],"names":["module","exports","render","_vm","this","_h","$createElement","_c","_self","staticClass","attrs","_v","directives","name","rawName","pre","staticRenderFns","components","FeedbackInvite","BuyCopyInvite","NewsletterInput","ChapterHeading","ChapterBibliography","TOCChapter","NavBar","BIconLink45deg","Footer","created","window","data","publicPath","metaInfo","title","htmlAttrs","lang","meta","charset","content","property","link","rel","href","component"],"mappings":"qGAAAA,EAAOC,QAAU,IAA0B,8C,uBCA3CD,EAAOC,QAAU,IAA0B,oD,qBCA3CD,EAAOC,QAAU,IAA0B,8C,2CCA3C,IAAIC,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACA,EAAG,UAAUA,EAAG,MAAM,CAACE,YAAY,mBAAmB,CAACF,EAAG,QAAQ,CAACA,EAAG,aAAa,CAACG,MAAM,CAAC,aAAa,6BAA6BH,EAAG,SAASA,EAAG,QAAQ,CAACG,MAAM,CAAC,KAAO,OAAO,GAAK,MAAM,CAACH,EAAG,iBAAiB,CAACG,MAAM,CAAC,gBAAgB,mCAAmC,aAAa,oBAAoB,YAAY,0BAA0BH,EAAG,MAAM,CAACE,YAAY,SAASC,MAAM,CAAC,GAAK,yCAAyCH,EAAG,KAAK,CAACG,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A0B,gC,qBCA3CD,EAAOC,QAAU,IAA0B","file":"js/chunk-85a3df24.92d2f9ed.js","sourcesContent":["module.exports = __webpack_public_path__ + \"img/create_gist_documentation.80673463.png\";","module.exports = __webpack_public_path__ + \"img/authentification_github_api_doc.1884ab71.png\";","module.exports = __webpack_public_path__ + \"img/delete_gist_documentation.2dc0ac15.png\";","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('NavBar'),_c('div',{staticClass:\"container-fluid\"},[_c('b-row',[_c('TOCChapter',{attrs:{\"chapter-id\":\"Chap35BuildAnHttpClient\"}}),_c('b-col'),_c('b-col',{attrs:{\"role\":\"main\",\"md\":\"6\"}},[_c('ChapterHeading',{attrs:{\"chapter-title\":\"Chapter 35: Build an HTTP Client\",\"image-name\":\"consuming-api.jpg\",\"image-alt\":\"Build an HTTP Client\"}}),_c('div',{staticClass:\"anchor\",attrs:{\"id\":\"what-will-you-learn-in-this-chapter\"}}),_c('h1',{attrs:{\"data-number\":\"1\"}},[_c('span',{staticClass:\"header-section-number\"},[_vm._v(\"1\")]),_vm._v(\" What will you learn in this chapter? \"),_c('a',{attrs:{\"href\":\"#what-will-you-learn-in-this-chapter\"}},[_c('b-icon-link45deg',{staticClass:\"heading-link-icon\",attrs:{\"font-scale\":\"0.7\"}})],1)]),_c('ul',[_c('li',[_c('p',[_vm._v(\"What is the client/server model?\")])]),_c('li',[_c('p',[_vm._v(\"How to create an HTTP client.\")])]),_c('li',[_c('p',[_vm._v(\"How to send HTTP requests.\")])]),_c('li',[_c('p',[_vm._v(\"How to add specific headers to your requests.\")])])]),_c('div',{staticClass:\"anchor\",attrs:{\"id\":\"technical-concepts-covered\"}}),_c('h1',{attrs:{\"data-number\":\"2\"}},[_c('span',{staticClass:\"header-section-number\"},[_vm._v(\"2\")]),_vm._v(\" Technical concepts covered \"),_c('a',{attrs:{\"href\":\"#technical-concepts-covered\"}},[_c('b-icon-link45deg',{staticClass:\"heading-link-icon\",attrs:{\"font-scale\":\"0.7\"}})],1)]),_c('ul',[_c('li',[_c('p',[_vm._v(\"Header\")])]),_c('li',[_c('p',[_vm._v(\"Client/Server\")])]),_c('li',[_c('p',[_vm._v(\"HTTP\")])])]),_c('div',{staticClass:\"anchor\",attrs:{\"id\":\"client-server\"}}),_c('h1',{attrs:{\"data-number\":\"3\"}},[_c('span',{staticClass:\"header-section-number\"},[_vm._v(\"3\")]),_vm._v(\" Client / Server \"),_c('a',{attrs:{\"href\":\"#client-server\"}},[_c('b-icon-link45deg',{staticClass:\"heading-link-icon\",attrs:{\"font-scale\":\"0.7\"}})],1)]),_c('div',{staticClass:\"anchor\",attrs:{\"id\":\"example-1\"}}),_c('h4',{attrs:{\"data-number\":\"3.0.0.1\"}},[_c('span',{staticClass:\"header-section-number\"},[_vm._v(\"3.0.0.1\")]),_vm._v(\" Example 1 \"),_c('a',{attrs:{\"href\":\"#example-1\"}},[_c('b-icon-link45deg',{staticClass:\"heading-link-icon\",attrs:{\"font-scale\":\"0.7\"}})],1)]),_c('p',[_vm._v(\"Imagine that you have developed a Go Program that is managing your pictures. This program is handling your library of photos on your computer. You might want to share those pictures with other family members; to do that, you can send them an email with all your pictures in it. This solution might be impossible if you have taken ten thousand pictures.\")]),_c('p',[_vm._v(\"You can upload the content automatically to your favorite social network. The operation could become time-consuming if you have to do it one picture at a time. The other solution might be to plug your program directly to the social network systems to upload the pictures programmatically.\")]),_c('p',[_vm._v(\"We can do this with the help of the API exposed by the social network. You can push your pictures in a for loop by calling their API directly.\")]),_c('p',[_vm._v(\"In this case, you will consume an API. You are the \"),_c('strong',[_vm._v(\"client\")]),_vm._v(\". The social network represents the \"),_c('strong',[_vm._v(\"Server\")]),_vm._v(\".\")]),_c('div',{staticClass:\"anchor\",attrs:{\"id\":\"example-2\"}}),_c('h4',{attrs:{\"data-number\":\"3.0.0.2\"}},[_c('span',{staticClass:\"header-section-number\"},[_vm._v(\"3.0.0.2\")]),_vm._v(\" Example 2 \"),_c('a',{attrs:{\"href\":\"#example-2\"}},[_c('b-icon-link45deg',{staticClass:\"heading-link-icon\",attrs:{\"font-scale\":\"0.7\"}})],1)]),_c('p',[_vm._v(\"Receiving and processing payments is a difficult task. The vast majority of e-commerce websites will use a payment provider. The website will call the payment provider to initiate card payments. In this context, the website is the client, and the payment provider is the server.\")]),_c('div',{staticClass:\"anchor\",attrs:{\"id\":\"example-3\"}}),_c('h4',{attrs:{\"data-number\":\"3.0.0.3\"}},[_c('span',{staticClass:\"header-section-number\"},[_vm._v(\"3.0.0.3\")]),_vm._v(\" Example 3 \"),_c('a',{attrs:{\"href\":\"#example-3\"}},[_c('b-icon-link45deg',{staticClass:\"heading-link-icon\",attrs:{\"font-scale\":\"0.7\"}})],1)]),_c('p',[_vm._v(\"If you want to integrate into your website a widget that displays the current temperature in San Francisco, you can build an API Client that will request a meteorological API (Server). Then parse the response and finally display it on your website homepage.\")]),_c('div',{staticClass:\"anchor\",attrs:{\"id\":\"api-call\"}}),_c('h4',{attrs:{\"data-number\":\"3.0.0.4\"}},[_c('span',{staticClass:\"header-section-number\"},[_vm._v(\"3.0.0.4\")]),_vm._v(\" API Call \"),_c('a',{attrs:{\"href\":\"#api-call\"}},[_c('b-icon-link45deg',{staticClass:\"heading-link-icon\",attrs:{\"font-scale\":\"0.7\"}})],1)]),_c('p',[_vm._v(\"Calling an API means making an HTTP(s) request to a web server by following a precise documentation.\")]),_c('p',[_vm._v(\"The terms client and server are important, and you must memorize them.\")]),_c('ul',[_c('li',[_c('p',[_vm._v(\"As a \"),_c('strong',[_vm._v(\"client\")]),_vm._v(\" we use (or consume) an API.\")])]),_c('li',[_c('p',[_vm._v(\"The \"),_c('strong',[_vm._v(\"server\")]),_vm._v(\" is a computer program that is designed to accept and respond to API Calls of clients.\")])])]),_c('figure',[_c('b-img',{staticClass:\"img-book\",attrs:{\"src\":require('@/assets/images/client_server.png'),\"alt\":\"Client-Server\",\"fluid\":\"\",\"thumbnail\":\"\"}}),_c('figcaption',{attrs:{\"aria-hidden\":\"true\"}},[_vm._v(\"Client-Server\")])],1),_c('div',{staticClass:\"anchor\",attrs:{\"id\":\"what-is-a-rest-api\"}}),_c('BuyCopyInvite'),_c('h1',{attrs:{\"data-number\":\"4\"}},[_c('span',{staticClass:\"header-section-number\"},[_vm._v(\"4\")]),_vm._v(\" What is a REST API \"),_c('a',{attrs:{\"href\":\"#what-is-a-rest-api\"}},[_c('b-icon-link45deg',{staticClass:\"heading-link-icon\",attrs:{\"font-scale\":\"0.7\"}})],1)]),_c('p',[_vm._v(\"REST stands for Representational State Transfer. Roy Fielding created the term in his doctorate thesis in 2000. Fielding wanted to develop a “model for the modern Web architecture”\"),_c('b-link',{staticClass:\"citation\",attrs:{\"data-cites\":\"fielding2000architectural\",\"href\":\"#fielding2000architectural\"}},[_vm._v(\"[@fielding2000architectural]\")]),_vm._v(\". He introduced REST which is an “architectural style”, a set of architectural constraints to build network-based applications.\")],1),_c('p',[_vm._v(\"Note that Fielding has defined the concept of REST, but we used those architectural constraints before his thesis. REST is now widely used among the web community; we even invented an adjective for defining APIs that follow this architectural style: RESTful.\")]),_c('p',[_vm._v(\"The API consumer and its producer (the developers behind it) can benefit from these constraints. The API producers follow the guidelines, but they are also free to ignore constraints. On the other side, APIs consumers can build software quicker because, at the technical level, APIs are built following the same standards. They are plenty of libraries (modules) that are freely available to build either the server part or the client part.\")]),_c('p',[_vm._v(\"What are exactly those constraints?\")]),_c('ul',[_c('li',[_c('p',[_vm._v(\"Communication is \"),_c('strong',[_vm._v(\"stateless\")]),_vm._v(\" : it means that the server doesn’t keep information about sessions, each request is treated individually. The server does not remember your previous requests. Therefore each request might contain all the necessary information for the server to handle it.\")])]),_c('li',[_c('p',[_c('strong',[_vm._v(\"Cacheable responses\")]),_vm._v(\" : the responses sent by the server can be cached to be used for later requests.\")])]),_c('li',[_c('p',[_c('strong',[_vm._v(\"Uniform interface\")]),_vm._v(\" : REST APIs always have the same interface for consumers. This uniform interface is built following three sub-constraints :\")]),_c('ul',[_c('li',[_c('p',[_c('u',[_vm._v(\"Identification of ressources\")]),_vm._v(\" : Each ressource of your service (an order, a product, a photo) is addressed by an unique ressource identifier (URI).\")]),_c('ul',[_c('li',[_vm._v(\"For instance : \"),_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"https://maximilien-andile.com/product/2\")])]),_vm._v(\" represent the URL of the product number 2 resource.\")])])]),_c('li',[_c('p',[_c('u',[_vm._v(\"Manipulation of resources through representations\")]),_vm._v(\" : when you use an API, you are manipulating a representation of the resource. The resource can be represented as JSON, XML, YAML...\")])]),_c('li',[_c('p',[_c('u',[_vm._v(\"Self-descriptive messages\")]),_vm._v(\" : messages that are exchanged between the client and server must contain all the necessary information to be correctly handled, and this information should be transmitted in a way that clients can easily understand it and servers. To do so, APIs builders use HTTP methods (the norm HTTP 1.1 defines eight methods), HTTP Headers, the body of the request but also the query string.\")])]),_c('li',[_c('p',[_c('u',[_vm._v(\"Hypermedia as the engine of application state\")]),_vm._v(\" (\"),_c('strong',[_vm._v(\"HATEOAS\")]),_vm._v(\"): the web server can send links that points to the resource itself or the linked resources. For instance, if a consumer sends a request to \"),_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"https://maximilien-andile.com/product/2\")])]),_vm._v(\" to get information about product 2, the web server can also send to the client links to the product variants (color, size, ...).\")])])])]),_c('li',[_c('p',[_c('strong',[_vm._v(\"Layered system\")]),_vm._v(\" : when building an API, you can have a specific system to handle authentication of your requests, another component responsible for retrieving the data in databases and formatting the response... From the client’s point of view, those layers should be invisible.\")])]),_c('li',[_c('p',[_c('strong',[_vm._v(\"Code on demand\")]),_vm._v(\" : this last constraint is optional, and in reality, it’s not used intensively in the industry. It allows a web server to return scripts to clients. Clients can then execute those scripts in their system. The advertisement industry uses this feature a lot; they expose APIs to distribute Javascript or HTML banners to their clients.\")])])]),_c('p',[_vm._v(\"You can find an overview of HTTP in the section \"),_c('a',{attrs:{\"href\":\"#sec:What-is-HTTP\",\"data-reference-type\":\"ref\",\"data-reference\":\"sec:What-is-HTTP\"}},[_vm._v(\"[sec:What-is-HTTP]\")]),_vm._v(\".\")]),_c('div',{staticClass:\"anchor\",attrs:{\"id\":\"a-basic-http-client\"}}),_c('h1',{attrs:{\"data-number\":\"5\"}},[_c('span',{staticClass:\"header-section-number\"},[_vm._v(\"5\")]),_vm._v(\" A basic HTTP Client \"),_c('a',{attrs:{\"href\":\"#a-basic-http-client\"}},[_c('b-icon-link45deg',{staticClass:\"heading-link-icon\",attrs:{\"font-scale\":\"0.7\"}})],1)]),_c('p',[_vm._v(\"The \"),_c('strong',[_vm._v(\"client\")]),_vm._v(\" is the party that will send the request to the \"),_c('strong',[_vm._v(\"server\")]),_vm._v(\".\")]),_c('p',[_vm._v(\"We will use the standard Go client from \"),_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"net/http\")])]),_c('a',{staticClass:\"footnote-ref\",attrs:{\"href\":\"#fn1\",\"id\":\"fnref1\",\"role\":\"doc-noteref\"}},[_c('sup',[_vm._v(\"1\")])]),_vm._v(\". To initialize an HTTP client, simply create a variable of type \"),_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"http.Client\")])]),_vm._v(\" :\")]),_c('pre',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\"}},[_vm._v(\"// consuming-api/simple/main.go\\npackage main\\n\\nimport (\\n \\\"fmt\\\"\\n \\\"io/ioutil\\\"\\n \\\"net/http\\\"\\n \\\"time\\\"\\n)\\n\\nfunc main() {\\n c := http.Client{Timeout: time.Duration(1) * time.Second}\\n resp, err := c.Get(\\\"https://www.google.com\\\")\\n if err != nil {\\n fmt.Printf(\\\"Error %s\\\", err)\\n return\\n }\\n defer resp.Body.Close()\\n body, err := ioutil.ReadAll(resp.Body)\\n fmt.Printf(\\\"Body : %s\\\", body)\\n}\")])]),_c('p',[_vm._v(\"When you create an HTTP client, you can specify the following options : \"),_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"Transport\")])]),_vm._v(\" (type : \"),_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"http.RoundTripper\")])]),_vm._v(\"): You can custom the way your HTTP requests will be executed by setting this field to a type that implements the type interface \"),_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"http.RoundTripper\")])]),_vm._v(\".\")]),_c('ul',[_c('li',[_vm._v(\"This is an advanced usage that you do not need most of the time. When you create the server, you can omit this parameter. In that case, \"),_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"DefaultTransport\")])]),_vm._v(\" is used. If you are curious, its source code is located here: https://golang.org/src/net/http/transport.go\")])]),_c('p',[_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"CheckRedirect\")])]),_vm._v(\" (type \"),_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"func(req *Request, via []*Request)\")])]),_vm._v(\"): we can use this field to define a function that will be called each time your request is redirected. A redirection is triggered when the server sends a special response. The response received has a special Code (HTTP Status Code) (see the section about HTTP basics to get more information about redirections).\")]),_c('ul',[_c('li',[_vm._v(\"The use-case here is checking things before following redirections.\")])]),_c('p',[_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"Jar\")])]),_vm._v(\" (type \"),_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"CookieJar\")])]),_vm._v(\"): with this field, you can add cookies to your request. Cookies are passed to the server. The server himself can add cookies to the request. Those “inbound cookies” will be added to the jar.\")]),_c('ul',[_c('li',[_c('p',[_vm._v(\"A cookie is a piece of data stored on the client side by web browsers.\")]),_c('ul',[_c('li',[_c('p',[_vm._v(\"You can set cookies via javascript code\")])]),_c('li',[_c('p',[_vm._v(\"The server can also set them via a specific header.\")])])])])]),_c('p',[_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"Timeout\")])]),_vm._v(\"(type \"),_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"time.Duration\")])]),_vm._v(\"): your client will open a connection to the server via HTTP; the server may take some time to answer your request. This field will define a maximum time to wait for the response. If you do not specify a timeout, there is no timeout by default. This can be dangerous for the user-perceived performance of your service. It’s better, in my opinion, to display an error than to make the user wait indefinitely. Note that this time includes:\")]),_c('ul',[_c('li',[_c('p',[_vm._v(\"Connection time (the time needed to connect to the distant server)\")]),_c('ul',[_c('li',[_c('p',[_vm._v(\"Time taken by redirects (if any)\")])]),_c('li',[_c('p',[_vm._v(\"Time is taken to read the response body.\")])])])])]),_c('p',[_vm._v(\"We build an HTTP Client with the DefaultTransport, no CheckRedirect function, no cookies but a timeout set to 1 second.\")]),_c('p',[_vm._v(\"With that client, we can send requests to the web server. In our example, we make an http request with the GET method to the URL https://www.google.com :\")]),_c('pre',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\"}},[_vm._v(\"resp, err := c.Get(\\\"https://www.google.com\\\")\\nif err != nil {\\n fmt.Errorf(\\\"Error %s\\\", err)\\n return\\n}\")])]),_c('p',[_vm._v(\"You have a similar API to use the HTTP \"),_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"POST\")])]),_vm._v(\" method :\")]),_c('pre',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\"}},[_vm._v(\"myJson := bytes.NewBuffer([]byte(`{\\\"name\\\":\\\"Maximilien\\\"}`))\\nresp, err := c.Post(\\\"https://www.google.com\\\", \\\"application/json\\\", myJson)\\nif err != nil {\\n fmt.Errorf(\\\"Error %s\\\", err)\\n return\\n}\")])]),_c('p',[_vm._v(\"Note that in the case of the POST method, in addition to the URL, we must define the body of the request and the content-type of the data. The body of the request is the data we send. Why not simply put a JSON string? Why do we use a \"),_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"bytes.Buffer\")])]),_vm._v(\" ? That’s because this argument must implement the interface \"),_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"io.Reader\")])]),_vm._v(\" !\")]),_c('p',[_vm._v(\"To make an \"),_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"HEAD\")])]),_vm._v(\" request the syntax is close :\")]),_c('pre',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\"}},[_vm._v(\"resp, err = c.Head(\\\"https://www.google.com\\\")\\nif err != nil {\\n fmt.Errorf(\\\"Error %s\\\", err)\\n return\\n}\\nfmt.Println(resp.Header)\")])]),_c('p',[_vm._v(\"Note than a \"),_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"HEAD\")])]),_vm._v(\" request does not return a body. However, it returns the headers received in response. (this method is used to test URL, to check if they are valid, accessible or recently modified \"),_c('b-link',{staticClass:\"citation\",attrs:{\"data-cites\":\"fielding1999rfc\",\"href\":\"#fielding1999rfc\"}},[_vm._v(\"[@fielding1999rfc]\")]),_vm._v(\").\")],1),_c('p',[_vm._v(\"Let’s get back to the end of our script :\")]),_c('pre',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\"}},[_vm._v(\"defer resp.Body.Close()\\nbody, err := ioutil.ReadAll(resp.Body)\\nfmt.Printf(\\\"Body : %s\\\", body)\")])]),_c('p',[_vm._v(\"We close the body when the function returns with \"),_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"defer resp.Body.Close()\")])]),_c('strong',[_vm._v(\".\")]),_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"resp.Body\")])]),_vm._v(\" is a stream of data read by the http client. Do not forget to add this closing instruction; otherwise, the client might not reuse a potential persistent connection to the server (cf. https://golang.org/pkg/net/http/#Client.Do).\")]),_c('div',{staticClass:\"anchor\",attrs:{\"id\":\"request-headers\"}}),_c('h1',{attrs:{\"data-number\":\"6\"}},[_c('span',{staticClass:\"header-section-number\"},[_vm._v(\"6\")]),_vm._v(\" Request Headers \"),_c('a',{attrs:{\"href\":\"#request-headers\"}},[_c('b-icon-link45deg',{staticClass:\"heading-link-icon\",attrs:{\"font-scale\":\"0.7\"}})],1)]),_c('div',{staticClass:\"anchor\",attrs:{\"id\":\"what-is-a-request-header\"}}),_c('h2',{attrs:{\"data-number\":\"6.1\"}},[_c('span',{staticClass:\"header-section-number\"},[_vm._v(\"6.1\")]),_vm._v(\" What is a request header? \"),_c('a',{attrs:{\"href\":\"#what-is-a-request-header\"}},[_c('b-icon-link45deg',{staticClass:\"heading-link-icon\",attrs:{\"font-scale\":\"0.7\"}})],1)]),_c('p',[_vm._v(\"Request Headers, or simply headers, are fields that are attached to the request. The client (your program) can use those fields to transmit additional pieces of information to the server about the request or himself \"),_c('b-link',{staticClass:\"citation\",attrs:{\"data-cites\":\"fielding1999hypertext\",\"href\":\"#fielding1999hypertext\"}},[_vm._v(\"[@fielding1999hypertext]\")]),_vm._v(\".\")],1),_c('p',[_vm._v(\"The specification of HTTP 1/1 allows you to use several header fields. Here is a shortlist of headers that are habitually used : \"),_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"Content-Type\")])]),_vm._v(\" : it indicates to the server what type of media you will transmit in the request\")]),_c('ul',[_c('li',[_c('p',[_vm._v(\"Value example :\")]),_c('p',[_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"application/json; charset=utf-8\")])]),_vm._v(\" => for JSON data encoded in UTF-8\")])])]),_c('p',[_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"Content-Length\")])]),_vm._v(\" : this is the size of the message sent (in bytes)\")]),_c('ul',[_c('li',[_c('p',[_vm._v(\"Value Example :\")]),_c('p',[_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"42\")])])])])]),_c('p',[_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"User-Agent\")])]),_vm._v(\" : the name and the version of the program that sends the request.\")]),_c('ul',[_c('li',[_c('p',[_vm._v(\"Value Example :\")]),_c('p',[_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"curl/7.16.3 libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3\")])]),_vm._v(\" If you use curl to perform your request\")]),_c('pre',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\"}},[_vm._v(\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36\")])]),_c('p',[_vm._v(\"If you use chrome on a MacBook\")])])]),_c('p',[_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"Accept\")])]),_vm._v(\" : specify which media types are acceptable for the response\")]),_c('ul',[_c('li',[_c('p',[_vm._v(\"Value Example\")]),_c('p',[_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"*/*\")])]),_vm._v(\" All media types are accepted\")]),_c('p',[_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"application/json\")])]),_vm._v(\" : is you accept only JSON\")])])]),_c('p',[_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"Accept-Encoding\")])]),_vm._v(\" : specify which types of encoding are acceptable in the response.\")]),_c('ul',[_c('li',[_c('p',[_vm._v(\"Value Example\")]),_c('p',[_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"gzip\")])]),_vm._v(\" gzipped (compressed) content is accepted\")])])]),_c('p',[_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"Authorization\")])]),_vm._v(\" : in this header, the sender can specify its credentials (API key, username/password, JWT .…)\")]),_c('ul',[_c('li',[_c('p',[_vm._v(\"Value Example\")]),_c('p',[_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"Bearer cGFydDJibGEcGFydDJibGEcGFydDJibGEcGFydDJibGE=.cGFydDJcGFydDJibGEcGFydDJibGEcGFydDJibGEibGE=.eW9sbcGFydDJibGEcGFydDJibGEcGFydDJibGEw==\")])])])])]),_c('div',{staticClass:\"anchor\",attrs:{\"id\":\"how-to-add-a-header-to-the-request\"}}),_c('h2',{attrs:{\"data-number\":\"6.2\"}},[_c('span',{staticClass:\"header-section-number\"},[_vm._v(\"6.2\")]),_vm._v(\" How to add a header to the request \"),_c('a',{attrs:{\"href\":\"#how-to-add-a-header-to-the-request\"}},[_c('b-icon-link45deg',{staticClass:\"heading-link-icon\",attrs:{\"font-scale\":\"0.7\"}})],1)]),_c('p',[_vm._v(\"To add a header, you have to build the request. It’s more verbose but building the method allows you to gain more control.\")]),_c('pre',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\"}},[_vm._v(\"// consuming-api/request-building/main.go\\npackage main\\n\\nimport (\\n \\\"fmt\\\"\\n \\\"io/ioutil\\\"\\n \\\"net/http\\\"\\n \\\"time\\\"\\n)\\n\\nfunc main() {\\n\\n c := http.Client{Timeout: time.Duration(1) * time.Second}\\n req, err := http.NewRequest(\\\"GET\\\", \\\"http://www.google.fr\\\", nil)\\n if err != nil {\\n fmt.Printf(\\\"error %s\\\", err)\\n return\\n }\\n req.Header.Add(\\\"Accept\\\", `application/json`)\\n resp, err := c.Do(req)\\n if err != nil {\\n fmt.Printf(\\\"error %s\\\", err)\\n return\\n }\\n defer resp.Body.Close()\\n body, err := ioutil.ReadAll(resp.Body)\\n fmt.Printf(\\\"Body : %s\\\", body)\\n}\")])]),_c('p',[_vm._v(\"We have to create a client and then use the \"),_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"http.NewRequest\")])]),_vm._v(\" method which has the following signature :\")]),_c('pre',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\"}},[_vm._v(\"(method, url string, body io.Reader) (*Request, error)\")])]),_c('p',[_vm._v(\"The first parameter is the \"),_c('strong',[_vm._v(\"method\")]),_vm._v(\" which can be one of the following :\")]),_c('ul',[_c('li',[_c('p',[_vm._v(\"OPTIONS\")])]),_c('li',[_c('p',[_vm._v(\"GET\")])]),_c('li',[_c('p',[_vm._v(\"HEAD\")])]),_c('li',[_c('p',[_vm._v(\"POST\")])]),_c('li',[_c('p',[_vm._v(\"PUT\")])]),_c('li',[_c('p',[_vm._v(\"DELETE\")])]),_c('li',[_c('p',[_vm._v(\"TRACE\")])]),_c('li',[_c('p',[_vm._v(\"CONNECT\")])])]),_c('p',[_vm._v(\"Then you provide the URL. The body is the third parameter of this method. In our case, we set it to nil because we do not have a body to send. The method will not send the request but will return an \"),_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"http.Request\")])]),_vm._v(\". With \"),_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"req.Header.Add\")])]),_vm._v(\" (where \"),_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"req\")])]),_vm._v(\" is a struct of type \"),_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"htttp.Request\")])]),_vm._v(\") you can append a header to the request :\")]),_c('pre',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\"}},[_vm._v(\"req.Header.Add(\\\"Accept\\\", `application/json`)\")])]),_c('p',[_vm._v(\"Note that the Header field of a request is under the hood, an element of type \"),_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"map[string][]string\")])]),_vm._v(\" a map where the keys are strings and the values are slices of strings.\")]),_c('p',[_vm._v(\"The request is sent with \"),_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"c.Do(req)\")])]),_vm._v(\".\")]),_c('div',{staticClass:\"anchor\",attrs:{\"id\":\"headers-automatically-sent\"}}),_c('h2',{attrs:{\"data-number\":\"6.3\"}},[_c('span',{staticClass:\"header-section-number\"},[_vm._v(\"6.3\")]),_vm._v(\" Headers automatically sent \"),_c('a',{attrs:{\"href\":\"#headers-automatically-sent\"}},[_c('b-icon-link45deg',{staticClass:\"heading-link-icon\",attrs:{\"font-scale\":\"0.7\"}})],1)]),_c('p',[_vm._v(\"Go will add some headers automatically to your requests :\")]),_c('p',[_vm._v(\"For a standard \"),_c('strong',[_vm._v(\"GET\")]),_vm._v(\" request :\")]),_c('pre',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\"}},[_vm._v(\"c.Get(\\\"http://localhost:8091/status\\\")\")])]),_c('ul',[_c('li',[_c('p',[_vm._v(\"Accept-Encoding : gzip\")])]),_c('li',[_c('p',[_vm._v(\"User-Agent: Go-http-client/1.1\")])])]),_c('p',[_vm._v(\"For a standard \"),_c('strong',[_vm._v(\"POST\")]),_vm._v(\" request :\")]),_c('pre',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\"}},[_vm._v(\"c.Post(\\\"http://localhost:8091/status\\\", \\\"application/json\\\", bytes.NewBuffer([]byte(\\\"42\\\")))\")])]),_c('ul',[_c('li',[_c('p',[_vm._v(\"Accept-Encoding : gzip\")])]),_c('li',[_c('p',[_vm._v(\"User-Agent: Go-http-client/1.1\")])]),_c('li',[_c('p',[_vm._v(\"Content-Length: 2\")])]),_c('li',[_c('p',[_vm._v(\"Content-Type: application/json\")])])]),_c('div',{staticClass:\"anchor\",attrs:{\"id\":\"real-world-example-the-github-api\"}}),_c('h1',{attrs:{\"data-number\":\"7\"}},[_c('span',{staticClass:\"header-section-number\"},[_vm._v(\"7\")]),_vm._v(\" Real-world example: the Github API \"),_c('a',{attrs:{\"href\":\"#real-world-example-the-github-api\"}},[_c('b-icon-link45deg',{staticClass:\"heading-link-icon\",attrs:{\"font-scale\":\"0.7\"}})],1)]),_c('div',{staticClass:\"anchor\",attrs:{\"id\":\"first-calls\"}}),_c('h3',{attrs:{\"data-number\":\"7.0.1\"}},[_c('span',{staticClass:\"header-section-number\"},[_vm._v(\"7.0.1\")]),_vm._v(\" First calls \"),_c('a',{attrs:{\"href\":\"#first-calls\"}},[_c('b-icon-link45deg',{staticClass:\"heading-link-icon\",attrs:{\"font-scale\":\"0.7\"}})],1)]),_c('p',[_vm._v(\"In this section, We will build an HTTP client that will send requests to the Github API. Github allows you to share code and collaborate on coding projects with other developers.\")]),_c('p',[_vm._v(\"Github exposes an API to search for projects, to get and update issues of a specific project... The possibilities that are open by the API of GitHub are very large.\")]),_c('p',[_vm._v(\"The documentation of the Github API is available on this website:\")]),_c('pre',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\"}},[_vm._v(\"https://developer.github.com/v3\")])]),_c('p',[_vm._v(\"In this example, we will use the v3 API.\")]),_c('p',[_vm._v(\"The base URL of the API is https://api.github.com/ ; let’s try to do an HTTP GET request on it.\")]),_c('pre',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\"}},[_vm._v(\"// consuming-api/github/main.go \\n\\nc := http.Client{Timeout: time.Duration(1) * time.Second}\\nreq, err := http.NewRequest(\\\"GET\\\", \\\"https://api.github.com/\\\", nil)\\nif err != nil {\\n fmt.Printf(\\\"error %s\\\", err)\\n return\\n}\\nreq.Header.Add(\\\"Accept\\\", `application/json`)\\nresp, err := c.Do(req)\\nif err != nil {\\n fmt.Printf(\\\"error %s\\\", err)\\n return\\n}\\ndefer resp.Body.Close()\\nbody, err := ioutil.ReadAll(resp.Body)\\nif err != nil {\\n fmt.Printf(\\\"error %s\\\", err)\\n return\\n}\\nfmt.Printf(\\\"Body : %s \\\\n \\\", body)\\nfmt.Printf(\\\"Response status : %s \\\\n\\\", resp.Status)\")])]),_c('p',[_vm._v(\"When we launch our script, we get the following output :\")]),_c('pre',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\"}},[_vm._v(\"Body : {\\\"current_user_url\\\":\\\"https://api.github.com/user\\\",\\\"current_user_authorizations_html_url\\\":\\\"https://github.com/settings/connections/applications{/clie\\nnt_id}\\\",\\n...\\n}\\n\\n Response status: 200 OK\")])]),_c('p',[_vm._v(\"The response body is JSON. Note that the three dots means that I have not printed the full body of the response. The status code of our response is “\"),_c('strong',[_vm._v(\"200 OK\")]),_vm._v(\"” which means that our request was successful.\")]),_c('p',[_vm._v(\"The body content suggests that we can ping the GitHub API using other routes. To get the current user, we can request https://api.github.com/user. Let’s try it :\")]),_c('pre',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\"}},[_vm._v(\"req, err := http.NewRequest(\\\"GET\\\", \\\"https://api.github.com/user\\\", nil)\")])]),_c('p',[_vm._v(\"The response is not very glamourous :\")]),_c('pre',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\"}},[_vm._v(\"Body : {\\\"message\\\":\\\"Requires authentication\\\",\\\"documentation_url\\\":\\\"https://developer.github.com/v3/users/#get-the-authenticated-user\\\"}\\n\\nResponse status: 401 Unauthorized\")])]),_c('p',[_vm._v(\"The status code is “401 Unauthorized”. It means that “the request requires user authentication. The response MUST include a WWW-Authenticate header field (section 14.47) containing a challenge applicable to the requested resource.”\"),_c('b-link',{staticClass:\"citation\",attrs:{\"data-cites\":\"fielding1999hypertext\",\"href\":\"#fielding1999hypertext\"}},[_vm._v(\"[@fielding1999hypertext]\")]),_vm._v(\".\")],1),_c('p',[_vm._v(\"Our requested resource (seeing details about the current user) requires that we prove our identity. To do that, we must register to Github. If you already have an account on Github, just go to that web page https://github.com/settings/tokens; if you do not have an account, you can create one if you want. Note that you can follow the tutorial without having a Github account. The idea is to have an idea on how to use an API.\")]),_c('p',[_vm._v(\"Most of the time, API providers require you to register before using their API to control who has access to the data.\")]),_c('div',{staticClass:\"anchor\",attrs:{\"id\":\"authorize-your-requests\"}}),_c('h3',{attrs:{\"data-number\":\"7.0.2\"}},[_c('span',{staticClass:\"header-section-number\"},[_vm._v(\"7.0.2\")]),_vm._v(\" Authorize your requests \"),_c('a',{attrs:{\"href\":\"#authorize-your-requests\"}},[_c('b-icon-link45deg',{staticClass:\"heading-link-icon\",attrs:{\"font-scale\":\"0.7\"}})],1)]),_c('p',[_vm._v(\"Navigate to https://github.com/settings/tokens. On this page, click on the button “Generate new token” :\")]),_c('figure',[_c('b-img',{staticClass:\"img-book\",attrs:{\"src\":require('@/assets/images/github_personnal_token.png'),\"alt\":\"Generate Github Personal Token\",\"fluid\":\"\",\"thumbnail\":\"\"}}),_c('figcaption',{attrs:{\"aria-hidden\":\"true\"}},[_vm._v(\"Generate Github Personal Token\")])],1),_c('p',[_vm._v(\"You will then be asked to give a name to your personal token and select the scopes that Github will attach to your new personal token. Selecting scopes allow you to restrict the usage of your personal token. In our example, we will just select “Gist”. By publishing a Gist, you can share code with other users. We will use the Github API to create Gists.\")]),_c('figure',[_c('b-img',{staticClass:\"img-book\",attrs:{\"src\":require('@/assets/images/github_new_token.png'),\"alt\":\"Generate Github Personal Token\",\"fluid\":\"\",\"thumbnail\":\"\"}}),_c('figcaption',{attrs:{\"aria-hidden\":\"true\"}},[_vm._v(\"Generate Github Personal Token\")])],1),_c('figure',[_c('b-img',{staticClass:\"img-book\",attrs:{\"src\":require('@/assets/images/create_gist_scope.png'),\"alt\":\"Create Gist scope Github API\",\"fluid\":\"\",\"thumbnail\":\"\"}}),_c('figcaption',{attrs:{\"aria-hidden\":\"true\"}},[_vm._v(\"Create Gist scope Github API\")])],1),_c('p',[_vm._v(\"Once you got your personal token, you can inject it into your requests. You might ask, where do I put it? If we follow the HTTP 1/1 RFC, then we have to inject it into an “Authenticate header field”. You must always read the API’s documentation because there is no unified way to inject authorization tokens.\")]),_c('p',[_vm._v(\"The Github API documentation specifies that we should inject the token into the Header Authorization :\")]),_c('figure',[_c('b-img',{staticClass:\"img-book\",attrs:{\"src\":require('@/assets/images/authentification_github_api_doc.png'),\"alt\":\"Authorization header of the GitHub API\",\"fluid\":\"\",\"thumbnail\":\"\"}}),_c('figcaption',{attrs:{\"aria-hidden\":\"true\"}},[_vm._v(\"Authorization header of the GitHub API\")])],1),_c('p',[_vm._v(\"Let’s try it. We will make the same call as before, but this time we will use an authentication header as suggested by the GitHub docs :\")]),_c('pre',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\"}},[_vm._v(\"// current user\\nreq, err = http.NewRequest(\\\"GET\\\", \\\"https://api.github.com/user\\\", nil)\\n// TODO : handle error\\nreq.Header.Add(\\\"Accept\\\", `application/json`)\\n// add header for authentication\\nreq.Header.Add(\\\"Authorization\\\", fmt.Sprintf(\\\"token %s\\\", os.Getenv(\\\"TOKEN\\\"))\\n// ...\")])]),_c('p',[_vm._v(\"The most important line of this listing is :\")]),_c('pre',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\"}},[_vm._v(\"req.Header.Add(\\\"Authorization\\\", fmt.Sprintf(\\\"token %s\\\", os.Getenv(\\\"GITHUB_TOKEN\\\"))\")])]),_c('p',[_vm._v(\"Note that we are not saving the access token directly in our script. This is a very bad idea because if you share your code, you do not want your fellow developers to access your Github account.\")]),_c('p',[_vm._v(\"Instead, we are using \"),_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"os.Getenv(\\\"GITHUB_TOKEN\\\")\")])]),_c('strong',[_vm._v(\".\")]),_vm._v(\" The Getenv method from the os standard package will retrieve the environment variable names \"),_c('strong',[_vm._v(\"TOKEN\")]),_vm._v(\" and parse it. Note that to handle your configuration, you can also use a configuration file. There are very popular packages that handle configuration for you (see chapter \"),_c('a',{attrs:{\"href\":\"#chap:Application-Configuration\",\"data-reference-type\":\"ref\",\"data-reference\":\"chap:Application-Configuration\"}},[_vm._v(\"[chap:Application-Configuration]\")]),_vm._v(\").\")]),_c('p',[_vm._v(\"To pass an environment variable to the program, just prepend \"),_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"GITHUB_TOKEN=XXX\")])]),_vm._v(\" to your command :\")]),_c('pre',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\"}},[_vm._v(\"$ GITHUB_TOKEN=aabbcc go run main.go\")])]),_c('div',{staticClass:\"anchor\",attrs:{\"id\":\"create-a-gist\"}}),_c('h3',{attrs:{\"data-number\":\"7.0.3\"}},[_c('span',{staticClass:\"header-section-number\"},[_vm._v(\"7.0.3\")]),_vm._v(\" Create a gist \"),_c('a',{attrs:{\"href\":\"#create-a-gist\"}},[_c('b-icon-link45deg',{staticClass:\"heading-link-icon\",attrs:{\"font-scale\":\"0.7\"}})],1)]),_c('p',[_vm._v(\"The first thing to do is to read the documentation. You can infer that if we want to create something, it will be a POST; the URI might contain gist, but that’s all. I made a screenshot of the documentation page :\")]),_c('figure',[_c('b-img',{staticClass:\"img-book\",attrs:{\"src\":require('@/assets/images/create_gist_documentation.png'),\"alt\":\"POST /gists documentation\",\"fluid\":\"\",\"thumbnail\":\"\"}}),_c('figcaption',{attrs:{\"aria-hidden\":\"true\"}},[_vm._v(\"POST /gists documentation\")])],1),_c('p',[_vm._v(\"The endpoint is specified as follow :\")]),_c('ul',[_c('li',[_c('p',[_vm._v(\"The HTTP verb to use is POST\")])]),_c('li',[_c('p',[_vm._v(\"The input parameters are\")]),_c('p',[_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"files\")])]),_vm._v(\" (which is an object)\")]),_c('p',[_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"description\")])]),_vm._v(\" : a string\")]),_c('p',[_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"public\")])]),_vm._v(\" which is a boolean value\")])])]),_c('p',[_vm._v(\"Let’s implement this call :\")]),_c('pre',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\"}},[_vm._v(\"// consuming-api/github-post-gist/main.go \\n\\nreq, err := http.NewRequest(\\\"POST\\\", \\\"https://api.github.com/gists\\\", bytes.NewBuffer(gistRequestJson))\\nif err != nil {\\n fmt.Printf(\\\"%s\\\", err)\\n return\\n}\\nreq.Header.Add(\\\"Accept\\\", `application/json`)\\n// add header for authentication\\nreq.Header.Add(\\\"Authorization\\\", fmt.Sprintf(\\\"token %s\\\", os.Getenv(\\\"TOKEN\\\")))\\n\\nresp, err := c.Do(req)\\nif err != nil {\\n fmt.Printf(\\\"Error %s\\\", err)\\n return\\n}\")])]),_c('p',[_vm._v(\"I didn’t inject the requested parameters to see what kind of error message we will have.\")]),_c('pre',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\"}},[_vm._v(\"Body : {\\\"message\\\":\\\"Invalid request.\\\\n\\\\nFor 'links/0/schema', nil is not an object.\\\",\\\"documentation_url\\\":\\\"https://developer.github.com/v3/gists/#create-a-gi\\nst\\\"}\\n Response status: 422 Unprocessable Entity\")])]),_c('p',[_vm._v(\"We’ve got an error; there might be an input validator somewhere in the Github server that controls the user input.\")]),_c('p',[_vm._v(\"The parameters will be transmitted in the body of the request. Parameters will be encoded in JSON. To do that, we will create a struct that will hold the parameters.\")]),_c('pre',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\"}},[_vm._v(\"type GistRequest struct {\\n Files map[string]File `json:\\\"files\\\"`\\n Description string `json:\\\"description\\\"`\\n Public bool `json:\\\"public\\\"`\\n}\\ntype File struct {\\n Content string `json:\\\"content\\\"`\\n}\")])]),_c('p',[_vm._v(\"Those struct types will hold the parameters of our request :\")]),_c('pre',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\"}},[_vm._v(\"files := map[string]File{\\n \\\"main.go\\\": File{\\\"test\\\"}}\\ngistRequest := GistRequest{\\n Files: files,\\n Description: \\\"this is a test\\\",\\n Public: false}\")])]),_c('p',[_vm._v(\"The variable \"),_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"gistRequest\")])]),_vm._v(\" needs to be transformed into a valid JSON string :\")]),_c('pre',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\"}},[_vm._v(\"gistRequestJson, err := json.Marshal(gistRequest)\\nif err != nil {\\n fmt.Printf(\\\"%s\\\", err)\\n return\\n}\")])]),_c('p',[_vm._v(\"Then we just have to populate the body of our request with our brand new JSON. There is just a little difficulty here : \"),_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"json.Marshal\")])]),_vm._v(\" returns a slice of bytes. The signature of \"),_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"NewRequest\")])]),_vm._v(\" is :\")]),_c('pre',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\"}},[_vm._v(\"func NewRequest(method, url string, body io.Reader) (*Request, error)\")])]),_c('p',[_vm._v(\"The body needs to implement the type interface \"),_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"io.Reader\")])]),_vm._v(\".\")]),_c('p',[_vm._v(\"To do that, there is a simple way, using the standard package \"),_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"bytes\")])]),_vm._v(\" :\")]),_c('pre',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\"}},[_vm._v(\"bytes.NewBuffer(gistRequestJson)\")])]),_c('p',[_vm._v(\"The returned value of \"),_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"bytes.NewBuffer\")])]),_vm._v(\" implements \"),_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"io.Reader\")])]),_vm._v(\".\")]),_c('p',[_vm._v(\"We can now launch the request :\")]),_c('pre',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\"}},[_vm._v(\"req, err := http.NewRequest(\\\"POST\\\", \\\"https://api.github.com/gists\\\", bytes.NewBuffer(gistRequestJson))\\nreq.Header.Add(\\\"Accept\\\", `application/json`)\\nreq.Header.Add(\\\"Authorization\\\", fmt.Sprintf(\\\"token %s\\\", os.Getenv(\\\"TOKEN\\\")))\\nresp, err := c.Do(req)\\n//...\")])]),_c('p',[_vm._v(\"The response is a success :\")]),_c('pre',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\"}},[_vm._v(\"Body : {\\\"url\\\":\\\"https://api.github.com/gists/c960d211532f7c35aeb0c854892bf108\\\",...}\\n Response status : 201 Created\")])]),_c('p',[_vm._v(\"The Gist has been created, as you can see in figure \"),_c('a',{attrs:{\"href\":\"#fig:Gist-created-through\",\"data-reference-type\":\"ref\",\"data-reference\":\"fig:Gist-created-through\"}},[_vm._v(\"1\")]),_vm._v(\". The URI of this new resource is returned in the body response :\")]),_c('p',[_vm._v(\"https://api.github.com/gists/c960d211532f7c35aeb0c854892bf108. It’s not always the case because APIs do not strictly follow the RFC’s recommendations. Do not be surprised if you do not get the URI in the response. Concerning the response status, it’s also not always “201 Created” but instead “200 OK”.\")]),_c('p',[_vm._v(\"Most of the time, you have to adapt your client to the API you are integrating. The response status code is not always the same; the authentication method can also be different.\")]),_c('figure',[_c('b-img',{staticClass:\"img-book\",attrs:{\"src\":require('@/assets/images/gist_created.png'),\"alt\":\"Gist created through API call[fig:Gist-created-through]\",\"fluid\":\"\",\"thumbnail\":\"\"}}),_c('figcaption',{attrs:{\"aria-hidden\":\"true\"}},[_vm._v(\"Gist created through API call\"),_c('span',{attrs:{\"id\":\"fig:Gist-created-through\",\"label\":\"fig:Gist-created-through\"}},[_vm._v(\"[fig:Gist-created-through]\")])])],1),_c('div',{staticClass:\"anchor\",attrs:{\"id\":\"update-a-gist\"}}),_c('h3',{attrs:{\"data-number\":\"7.0.4\"}},[_c('span',{staticClass:\"header-section-number\"},[_vm._v(\"7.0.4\")]),_vm._v(\" Update a Gist \"),_c('a',{attrs:{\"href\":\"#update-a-gist\"}},[_c('b-icon-link45deg',{staticClass:\"heading-link-icon\",attrs:{\"font-scale\":\"0.7\"}})],1)]),_c('p',[_vm._v(\"We have created a resource. Now we can try to update it. Most of the time, you update a resource with an HTTP \"),_c('strong',[_vm._v(\"PUT\")]),_vm._v(\" or \"),_c('strong',[_vm._v(\"PATCH\")]),_vm._v(\" request.\")]),_c('p',[_vm._v(\"Let’s take a look at the API documentation (\"),_c('a',{attrs:{\"href\":\"#fig:Update-a-Gist\",\"data-reference-type\":\"ref\",\"data-reference\":\"fig:Update-a-Gist\"}},[_vm._v(\"2\")]),_vm._v(\").\")]),_c('figure',[_c('b-img',{staticClass:\"img-book\",attrs:{\"src\":require('@/assets/images/edit_a_gist.png'),\"alt\":\"Update a Gist API documentation[fig:Update-a-Gist]\",\"fluid\":\"\",\"thumbnail\":\"\"}}),_c('figcaption',{attrs:{\"aria-hidden\":\"true\"}},[_vm._v(\"Update a Gist API documentation\"),_c('span',{attrs:{\"id\":\"fig:Update-a-Gist\",\"label\":\"fig:Update-a-Gist\"}},[_vm._v(\"[fig:Update-a-Gist]\")])])],1),_c('p',[_vm._v(\"The request use a PATCH method. The URL is \"),_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"/gist/:gist_id\")])]),_c('strong',[_vm._v(\",\")]),_vm._v(\"meaning that we have to replace \"),_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"gist_id\")])]),_vm._v(\" by the id of the gist, we want to modify. In the REST API world, each resource has an identifier, here in the case of a gist, the id is denoted \"),_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"gist_id\")])]),_vm._v(\". In our case the gist_id is c960d211532f7c35aeb0c854892bf108. So the request URL will be:\")]),_c('pre',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\"}},[_vm._v(\"\\\"https://api.github.com/gists/c960d211532f7c35aeb0c854892bf108\\\"\")])]),_c('p',[_vm._v(\"The parameters are the same as the POST request (to create the gist). The following listing will create the request body :\")]),_c('pre',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\"}},[_vm._v(\"// consuming-api/github-patch-gist/main.go \\n\\nfiles := map[string]File{\\n \\\"main.go\\\": File{\\\"test updated\\\"}}\\ngistRequest := GistRequest{\\n Files: files,\\n Description: \\\"this is a test\\\",\\n Public: false}\\ngistRequestJson, err := json.Marshal(gistRequest)\\nif err != nil {\\n fmt.Printf(\\\"%s\\\", err)\\n return\\n}\")])]),_c('p',[_vm._v(\"Here we are just updating the content of main.go that will become “test updated”. The next thing to do is to build or http client, create the request, execute it and display the result\")]),_c('pre',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\"}},[_vm._v(\"// consuming-api/github-patch-gist/main.go \\n\\nc := http.Client{Timeout: time.Duration(4) * time.Second}\\n\\nreq, err := http.NewRequest(\\\"PATCH\\\", \\\"https://api.github.com/gists/79c9cec21a116f6ee166fd73ba750565\\\", bytes.NewBuffer(gistRequestJson))\\nif err != nil {\\n fmt.Printf(\\\"%s\\\", err)\\n return\\n}\\nreq.Header.Add(\\\"Accept\\\", `application/json`)\\n// add header for authentication\\nreq.Header.Add(\\\"Authorization\\\", fmt.Sprintf(\\\"token %s\\\", os.Getenv(\\\"TOKEN\\\")))\\n\\nresp, err := c.Do(req)\\nif err != nil {\\n fmt.Printf(\\\"Error %s\\\", err)\\n return\\n}\\ndefer resp.Body.Close()\\nbody, err := ioutil.ReadAll(resp.Body)\\nfmt.Printf(\\\"Body : %s \\\\n \\\", body)\\nfmt.Printf(\\\"Response status : %s \\\\n\\\", resp.Status)\")])]),_c('p',[_vm._v(\"The execution result is :\")]),_c('pre',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\"}},[_vm._v(\"Body : {\\\"url\\\":\\\"https://api.github.com/gists/c960d211532f7c35aeb0c854892bf108\\\",...}\\n Response status : 200 OK\")])]),_c('p',[_vm._v(\"A response status of 200 indicates that the server has correctly handled the request.\")]),_c('p',[_vm._v(\"On the GitHub gist website, our gist has been updated! (see figure \"),_c('a',{attrs:{\"href\":\"#fig:Gist-updated-through\",\"data-reference-type\":\"ref\",\"data-reference\":\"fig:Gist-updated-through\"}},[_vm._v(\"3\")]),_vm._v(\")\")]),_c('figure',[_c('b-img',{staticClass:\"img-book\",attrs:{\"src\":require('@/assets/images/gist_updated.png'),\"alt\":\"Gist updated through API call[fig:Gist-updated-through]\",\"fluid\":\"\",\"thumbnail\":\"\"}}),_c('figcaption',{attrs:{\"aria-hidden\":\"true\"}},[_vm._v(\"Gist updated through API call\"),_c('span',{attrs:{\"id\":\"fig:Gist-updated-through\",\"label\":\"fig:Gist-updated-through\"}},[_vm._v(\"[fig:Gist-updated-through]\")])])],1),_c('div',{staticClass:\"anchor\",attrs:{\"id\":\"delete-a-gist\"}}),_c('h3',{attrs:{\"data-number\":\"7.0.5\"}},[_c('span',{staticClass:\"header-section-number\"},[_vm._v(\"7.0.5\")]),_vm._v(\" Delete a Gist \"),_c('a',{attrs:{\"href\":\"#delete-a-gist\"}},[_c('b-icon-link45deg',{staticClass:\"heading-link-icon\",attrs:{\"font-scale\":\"0.7\"}})],1)]),_c('p',[_vm._v(\"Deleting a resource using a web service is a common task. The http request method to do that is typically \"),_c('strong',[_vm._v(\"DELETE\")]),_vm._v(\". The Github API documentation is pretty straightforward (see figure \"),_c('a',{attrs:{\"href\":\"#fig:Delete-a-Gist\",\"data-reference-type\":\"ref\",\"data-reference\":\"fig:Delete-a-Gist\"}},[_vm._v(\"4\")]),_vm._v(\")\")]),_c('figure',[_c('b-img',{staticClass:\"img-book\",attrs:{\"src\":require('@/assets/images/delete_gist_documentation.png'),\"alt\":\"Delete a Gist documentation[fig:Delete-a-Gist]\",\"fluid\":\"\",\"thumbnail\":\"\"}}),_c('figcaption',{attrs:{\"aria-hidden\":\"true\"}},[_vm._v(\"Delete a Gist documentation\"),_c('span',{attrs:{\"id\":\"fig:Delete-a-Gist\",\"label\":\"fig:Delete-a-Gist\"}},[_vm._v(\"[fig:Delete-a-Gist]\")])])],1),_c('p',[_vm._v(\"The code is simpler than the previous request because we do not have to include a body :\")]),_c('pre',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\"}},[_vm._v(\"// consuming-api/github-gist-delete/main.go \\n\\nc := http.Client{Timeout: time.Duration(4) * time.Second}\\nreq, err := http.NewRequest(\\\"DELETE\\\", \\\"https://api.github.com/gists/79c9cec21a116f6ee166fd73ba750565\\\", nil)\\nif err != nil {\\n fmt.Printf(\\\"Error %s\\\", err)\\n return\\n}\\nreq.Header.Add(\\\"Accept\\\", `application/json`)\\n// add header for authentication\\nreq.Header.Add(\\\"Authorization\\\", fmt.Sprintf(\\\"token %s\\\", os.Getenv(\\\"TOKEN\\\")))\\n\\nresp, err := c.Do(req)\\nif err != nil {\\n fmt.Printf(\\\"Error %s\\\", err)\\n return\\n}\\ndefer resp.Body.Close()\\nbody, err := ioutil.ReadAll(resp.Body)\\nif err != nil {\\n fmt.Printf(\\\"Error %s\\\", err)\\n return\\n}\\nfmt.Printf(\\\"Body : %s \\\\n \\\", body)\\nfmt.Printf(\\\"Response status : %s \\\\n\\\", resp.Status)\")])]),_c('p',[_vm._v(\"The execution result shows an empty body and a response status code equal to 204 No Content :\")]),_c('pre',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\"}},[_vm._v(\"Body :\\n\\nResponse status : 204 No Content\")])]),_c('p',[_vm._v(\"The response status code is 2... meaning our request has been a success. We have deleted our gist.\")]),_c('div',{staticClass:\"anchor\",attrs:{\"id\":\"test-yourself\"}}),_c('BuyCopyInvite'),_c('h1',{attrs:{\"data-number\":\"8\"}},[_c('span',{staticClass:\"header-section-number\"},[_vm._v(\"8\")]),_vm._v(\" Test yourself \"),_c('a',{attrs:{\"href\":\"#test-yourself\"}},[_c('b-icon-link45deg',{staticClass:\"heading-link-icon\",attrs:{\"font-scale\":\"0.7\"}})],1)]),_c('div',{staticClass:\"anchor\",attrs:{\"id\":\"questions\"}}),_c('h2',{attrs:{\"data-number\":\"8.1\"}},[_c('span',{staticClass:\"header-section-number\"},[_vm._v(\"8.1\")]),_vm._v(\" Questions \"),_c('a',{attrs:{\"href\":\"#questions\"}},[_c('b-icon-link45deg',{staticClass:\"heading-link-icon\",attrs:{\"font-scale\":\"0.7\"}})],1)]),_c('ol',{attrs:{\"type\":\"1\"}},[_c('li',[_c('p',[_vm._v(\"True or False. The server is responsible for sending requests to the client.\")])]),_c('li',[_c('p',[_vm._v(\"Give two architectural constraints of a REST API (as defined in the Roy Fielding thesis).\")])]),_c('li',[_c('p',[_vm._v(\"How to create a basic HTTP client with a 3 seconds timeout?\")])]),_c('li',[_c('p',[_vm._v(\"In which header can you put user credentials?\")])]),_c('li',[_c('p',[_vm._v(\"If you send a POST request with the default Go, http client, which headers are already set?\")])])]),_c('div',{staticClass:\"anchor\",attrs:{\"id\":\"answers\"}}),_c('h2',{attrs:{\"data-number\":\"8.2\"}},[_c('span',{staticClass:\"header-section-number\"},[_vm._v(\"8.2\")]),_vm._v(\" Answers \"),_c('a',{attrs:{\"href\":\"#answers\"}},[_c('b-icon-link45deg',{staticClass:\"heading-link-icon\",attrs:{\"font-scale\":\"0.7\"}})],1)]),_c('ol',{attrs:{\"type\":\"1\"}},[_c('li',[_c('p',[_vm._v(\"True or False. The server is responsible for sending requests to the client.\")]),_c('ol',{attrs:{\"type\":\"1\"}},[_c('li',[_c('p',[_vm._v(\"False\")])]),_c('li',[_c('p',[_vm._v(\"The server receives and handles requests; the client sends requests.\")])])])]),_c('li',[_c('p',[_vm._v(\"Give two architectural constraints of a REST API (as defined in the Roy Fielding thesis).\")]),_c('ol',{attrs:{\"type\":\"1\"}},[_c('li',[_c('p',[_vm._v(\"Stateless\")])]),_c('li',[_c('p',[_vm._v(\"Responses are cacheable\")])]),_c('li',[_c('p',[_vm._v(\"Uniform interface\")])]),_c('li',[_c('p',[_vm._v(\"Layered systems\")])]),_c('li',[_c('p',[_vm._v(\"Code on demand\")])])])]),_c('li',[_c('p',[_vm._v(\"How to create a basic HTTP client with a 3 seconds timeout?\")]),_c('pre',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\"}},[_vm._v(\"c := http.Client{Timeout:1 * time.Second}\")])])]),_c('li',[_c('p',[_vm._v(\"In which header can you put user credentials?\")]),_c('ol',{attrs:{\"type\":\"1\"}},[_c('li',[_vm._v(\"In the \"),_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"Authorization\")])]),_vm._v(\" header\")])])]),_c('li',[_c('p',[_vm._v(\"If you send a POST request with the default Go, http client, which headers are already set?\")]),_c('ol',{attrs:{\"type\":\"1\"}},[_c('li',[_c('p',[_vm._v(\"User-Agent\")])]),_c('li',[_c('p',[_vm._v(\"Content-Length\")])]),_c('li',[_c('p',[_vm._v(\"Content-Type\")])]),_c('li',[_c('p',[_vm._v(\"Accept-Encoding\")])])])])]),_c('div',{staticClass:\"anchor\",attrs:{\"id\":\"key-takeaways\"}}),_c('h1',{attrs:{\"data-number\":\"9\"}},[_c('span',{staticClass:\"header-section-number\"},[_vm._v(\"9\")]),_vm._v(\" Key Takeaways \"),_c('a',{attrs:{\"href\":\"#key-takeaways\"}},[_c('b-icon-link45deg',{staticClass:\"heading-link-icon\",attrs:{\"font-scale\":\"0.7\"}})],1)]),_c('ul',[_c('li',[_c('p',[_vm._v(\"In the client/server model, the client requests a resource (or a service). The server provides access to this resource.\")])]),_c('li',[_c('p',[_vm._v(\"The server receives and handles requests; the client sends requests.\")])]),_c('li',[_c('p',[_vm._v(\"Servers are also called producers. Clients are also called consumers.\")])]),_c('li',[_c('p',[_vm._v(\"Roy Fielding has developed the term REST API in his doctoral thesis\")])]),_c('li',[_c('p',[_vm._v(\"Roy Fielding defined some architectural constraints used to build RESTful APIs.\")])]),_c('li',[_c('dl',[_c('dt',[_vm._v(\"To create an HTTP client, initialize a variable of type http.Client\")]),_c('dd',[_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"c := http.Client{Timeout:1 * time.Second}\")])]),_vm._v(\". Then you can use the client to send requests : \")])])])]),_c('pre',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\"}},[_vm._v(\"// Send simple GET and POST requests\\nres, err := c.Get(\\\"http://localhost:8091/status\\\")\\n// ....\\nres, err = c.Post(\\\"http://localhost:8091/status\\\", \\\"application/json\\\", bytes.NewBuffer([]byte(\\\"42\\\")))\\n\\n// Build more complex requests\\nreq, err := http.NewRequest(\\\"HEAD\\\", \\\"http://localhost:8091/status\\\", nil)\\n// ....\\nreq.Header.Add(\\\"Accept\\\", `application/json`)\\n// send the requests\\nc.Do(req)\")])]),_c('ul',[_c('li',[_c('p',[_vm._v(\"By default, the client has \"),_c('strong',[_vm._v(\"no timeout\")]),_vm._v(\" set. It’s important in your application to always configure this option (set the field \"),_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"Timeout\")])]),_vm._v(\" with an appropriate duration).\")])]),_c('li',[_c('p',[_vm._v(\"You can add additional headers to the request with \"),_c('span',{directives:[{name:\"highlightjs\",rawName:\"v-highlightjs\"}]},[_c('code',{pre:true,attrs:{\"class\":\"go\",\"style\":\"display: inline\"}},[_vm._v(\"request.Header.Add\")])])])])]),_c('section',{staticClass:\"footnotes\",attrs:{\"role\":\"doc-endnotes\"}},[_c('hr'),_c('ol',[_c('li',{attrs:{\"id\":\"fn1\",\"role\":\"doc-endnote\"}},[_c('p',[_vm._v(\"If you are curious, I suggest you take a look at the source code here : https://golang.org/src/net/http/client.go.\"),_c('a',{staticClass:\"footnote-back\",attrs:{\"href\":\"#fnref1\",\"role\":\"doc-backlink\"}},[_vm._v(\"↩︎\")])])])])]),_c('h1',[_vm._v(\"Bibliography\")]),_c('ChapterBibliography',{attrs:{\"chapter-id\":\"Chap35BuildAnHttpClient\"}}),_c('b-row',{staticClass:\"ml-1 mr-1 \"},[_c('b-col',{staticClass:\"text-center border mr-1 p-2\"},[_c('router-link',{attrs:{\"to\":{name:'Chap34Benchmarks'}}},[_c('p',[_c('u',[_c('small',[_vm._v(\"Previous\")])])]),_c('p',[_c('small',[_vm._v(\"Benchmarks\")])])])],1),_c('b-col',{staticClass:\"text-center border p-1 \"},[_c('router-link',{attrs:{\"to\":{name:'Chap36ProgramProfiling'}}},[_c('p',[_c('u',[_c('small',[_vm._v(\"Next\")])])]),_c('p',[_c('small',[_vm._v(\"Program Profiling\")])])])],1)],1),_c('b-row',{staticClass:\"mt-1 ml-1 mr-1\"},[_c('b-col',{staticClass:\"text-center border p-1 \"},[_c('b-link',{attrs:{\"to\":{name:'Home'}}},[_vm._v(\"Table of contents\")])],1)],1),_c('FeedbackInvite'),_c('NewsletterInput'),_c('Footer')],1),_c('b-col')],1)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Chap35BuildAnHttpClient.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Chap35BuildAnHttpClient.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./Chap35BuildAnHttpClient.vue?vue&type=template&id=7717f21f&scoped=true&\"\nimport script from \"./Chap35BuildAnHttpClient.vue?vue&type=script&lang=js&\"\nexport * from \"./Chap35BuildAnHttpClient.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"7717f21f\",\n null\n \n)\n\nexport default component.exports","module.exports = __webpack_public_path__ + \"img/github_new_token.0a62b9c2.png\";","module.exports = __webpack_public_path__ + \"img/create_gist_scope.57f5a4f7.png\";","module.exports = __webpack_public_path__ + \"img/gist_updated.6946c649.png\";","module.exports = __webpack_public_path__ + \"img/gist_created.282b16f2.png\";","module.exports = __webpack_public_path__ + \"img/client_server.4b85f4ad.png\";","module.exports = __webpack_public_path__ + \"img/edit_a_gist.da07d6b9.png\";","module.exports = __webpack_public_path__ + \"img/github_personnal_token.230b5aaf.png\";"],"sourceRoot":""}