WEEK 3: Entry 3
Have you ever felt like you know something but you still can’t explain it? Well, today at my internship, my manager surprised me with the question, “Do you know an HTTP request?” My answer was a no only because I did not want to say yes and end up giving an obscure explanation. For a second, I felt like he would be disappointed because it should be obvious for a CS student at my level to understand what an HTTP request is. On the other hand I was glad that I said no because he gave me a very simple explanation about what an HTTP request is. Simply put, HTTP requests are protocols that are used to access the resources hosted in a server. They are basically a communication tool that ensures the transfer of data from a client to a server. So why would he ask me that question? I figured out that it was just a chance for him to introduce me to the next task of my project. I started the issue of connecting the server that I finally deployed to Kubernetes to the Big Query API prior to today. Big Query is a Database as a service, DBaaS, that is offered by Google Cloud Platform to help house big data of companies that will need them to gain insights and use the data to make sound decisions. I like to call it enterprise data.
Even though I did use HTTP requests prior to today at Berea College, I must say that the idea is the same. However, the programming language methodology is different. My manager sent me a Golang article on how to make HTTP requests in Go so that I can familiarize myself with the processes and way of doing it. I met the same concepts that I knew before. These concepts are that for HTTP requests we have two types: the GET request and the POST request. As the names suggest, GET and POST are used to acquire and send data respectively from a server. What struck me with the article and tutorials is that GO uses built-in functions to execute these requests. I was able to finish reading the GET request and implementing it on my test project, but before I get started with the POST request, it was already time to clock out.
Besides, I understood the GET requests and the functions that are required to be requesting data from a specific source, say a server. Unlike how I used to just pass in the URL in a POST request function to grab the data, the Go procedure differs. For the GET request in Go, you need to invoke the resp function and pass the URL as an argument to access the data. Although the variable resp contains our request, if you print it out you would get a load of incoherent data which includes the header and properties of the request made. The incoherent data type comes in a struct format i.e different data types. I am still struggling to wrap my head around how to get the coherent data and convert it into a single data type. Thus, tomorrow I will be going through the article to figure this out before I consult my manager. For the past couple of weeks, I have learned that it is more ideal to try and figure out the solution before asking my manager. Thus, this is something that I intend to do throughout my internship. So too, I learn more by doing this.
Comments
Post a Comment