MuaathAlhaddad
3/31/2020 - 7:29 AM

How api request and response work ?

Facts

  • api request and reponse must be in JSON fromat
  • when the response fetched from the server,the response is the stream form(which are chunks of the whole data NOT the whole data), in order for us to get the whole body of the data, you need a method to compile all chucks of the data body, which text() do for us. after this the data body needs to be converted into json format. note: json() does these action together resolve stream and convert into json format