Hey Jonathan! How are you doing?
I see nobody as answered you yet. Have you find out eventually?
I suppose you’re referring to the lessons about Requests of the JS Course. I think it’s actually a good question and I had it myself when i followed that lessons too.
The answer is in the
helperFunctions.js file, generally there are always those two types of functions
renderRawResponse(). Conceptually they do exactly what their name says, check this one out for example:
If you test them out you see that they work in a similar way, but what is displayed in the html will be different:
- cleaned data merged into a
<p> html element in the first case
- an object printed as a string in the second one.
So the purpose of rendering the
renderRawResponse() is to show us what is the actual response that comes from the request, which clearly needs some refinement in order to be used in our website or web app.
Generally the use of the API is simply this:
- get some data from somewhere (raw input)
- take what you need (cleaning/polishing of the raw input)
- do some elaborations or rendering with it (service)
Hopefully this makes some sense.