![]() ![]() This port number acts a communication endpoint on a specific local IP address. When making use of your private IP address, you also need to include a port number in the URL. Preferably, you tether the hotspot of your mobile phone and connect your PC to your mobile network. In view of this, your mobile phone should be in the same network with your PC. Why?Īll requests will be made to my local web server. I made use of my private IP address and my mobile phone as my emulator. On the other hand, REST supports data structures in XML, JSON, or any other readable data structures Hey! Your local server requires some magical touch□. SOAP no doubt is flexible and lightweight but it relies heavily on XML. SOAP is an acronym that denotes: Simple Object Access Protocol. Clearly, we won’t be building a REST API as it falls outside the scope of this course but simply consuming the API. Our REST Client for this project is Retrofit and I’ll be making use of Laragon as my local web server. ![]() I’ve said that a lot of times already and I never want to get tired of saying it. I know this is an old chestnut: REST is a client-server architecture. Separate those things that change for different reasons. Gather together the things that change for the same reasons. The whole idea why annotations are used is summarized here by Robert C. And as such, it tries as much as possible to uncouple actual code from implementation thus promoting better modularization of code. Retrofit is a big fan of single responsibility principle. ![]() What’s the significance of these annotations in Retrofit? Some of these annotations include: GET, POST, DELETE e.t.c. Retrofit makes use of annotations that are in similitude with HTTP verbs to describe the type of action to be performed on the server. This article will dwell on consuming various API endpoints using HTTP verb POST. In the previous article in this series, we learnt the basis of retrofit and talked about the importance of HTTP verbs that enables the server understand the type of request made. There are two ways to write error-free programs only the third one works.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |