{"id":162,"date":"2026-06-03T06:41:17","date_gmt":"2026-06-03T06:41:17","guid":{"rendered":"https:\/\/gigz.pk\/javaapp\/?post_type=lesson&#038;p=162"},"modified":"2026-06-06T11:58:12","modified_gmt":"2026-06-06T11:58:12","slug":"rest-api-basics","status":"publish","type":"lesson","link":"https:\/\/gigz.pk\/javaapp\/?lesson=rest-api-basics","title":{"rendered":"REST API Basics"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">REST API Basics is one of the most important concepts in modern Android development. Almost every mobile application today depends on APIs to fetch, send, and update data from servers. Whether it is a social media app, e-commerce platform, banking system, or news application, REST APIs are the bridge between the app and the backend system.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Understanding REST APIs helps developers build dynamic applications that work with real-time data.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What is a REST API?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A REST API (Representational State Transfer Application Programming Interface) is a way for applications to communicate with a server using HTTP requests.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It allows an Android app to:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Get data from server<\/li>\n\n\n\n<li>Send data to server<\/li>\n\n\n\n<li>Update existing data<\/li>\n\n\n\n<li>Delete data from server<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">REST APIs act as a bridge between frontend (Android app) and backend (server\/database).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why REST APIs are Important?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">REST APIs are important because they:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Enable real-time data communication<\/li>\n\n\n\n<li>Connect mobile apps with servers<\/li>\n\n\n\n<li>Allow cloud-based applications<\/li>\n\n\n\n<li>Support dynamic content<\/li>\n\n\n\n<li>Improve scalability<\/li>\n\n\n\n<li>Reduce local storage dependency<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Without APIs, apps would only work with offline data.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How REST API Works<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">REST APIs work using HTTP methods.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The basic flow is:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Android app sends request<\/li>\n\n\n\n<li>Server processes request<\/li>\n\n\n\n<li>Server sends response<\/li>\n\n\n\n<li>App displays data<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The response is usually in JSON format.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Common HTTP Methods<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">REST APIs use different HTTP methods:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">GET<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Used to retrieve data from server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Get user list<\/li>\n\n\n\n<li>Fetch products<\/li>\n\n\n\n<li>Load posts<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">POST<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Used to send new data to server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>User registration<\/li>\n\n\n\n<li>Login request<\/li>\n\n\n\n<li>Create new record<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">PUT<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Used to update existing data.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Update profile<\/li>\n\n\n\n<li>Edit product details<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">DELETE<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Used to remove data.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Delete account<\/li>\n\n\n\n<li>Remove item from cart<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">What is JSON?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">JSON (JavaScript Object Notation) is the most common format used to exchange data in REST APIs.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n  \"name\": \"Ali\",\n  \"age\": 22,\n  \"city\": \"Faisalabad\"\n}\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">JSON is lightweight and easy to read.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">JSON Array Example<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;\n  {\n    \"name\": \"Ali\",\n    \"age\": 22\n  },\n  {\n    \"name\": \"Sara\",\n    \"age\": 25\n  }\n]\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This represents a list of users.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">REST API Structure<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A typical API request includes:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>URL (endpoint)<\/li>\n\n\n\n<li>Method (GET, POST, etc.)<\/li>\n\n\n\n<li>Headers<\/li>\n\n\n\n<li>Body (optional)<\/li>\n\n\n\n<li>Response<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Example endpoint:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>https:&#47;&#47;api.example.com\/users\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">API Response Example<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n  \"status\": \"success\",\n  \"data\": &#91;\n    {\n      \"id\": 1,\n      \"name\": \"Ali\"\n    }\n  ]\n}\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The app reads this response and displays data.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Making API Calls in Android<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Android uses libraries to connect with APIs. The most common is Retrofit.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What is Retrofit?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Retrofit is a type-safe HTTP client for Android used to consume REST APIs easily.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It simplifies:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>API requests<\/li>\n\n\n\n<li>JSON parsing<\/li>\n\n\n\n<li>Error handling<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Adding Retrofit Dependency<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>implementation 'com.squareup.retrofit2:retrofit:2.9.0'\nimplementation 'com.squareup.retrofit2:converter-gson:2.9.0'\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Creating API Interface<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>public interface ApiService {\n\n    @GET(\"users\")\n    Call&lt;List&lt;User&gt;&gt; getUsers();\n\n}\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This defines an API request.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Creating Retrofit Instance<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>Retrofit retrofit =\n        new Retrofit.Builder()\n                .baseUrl(\"https:\/\/api.example.com\/\")\n                .addConverterFactory(\n                        GsonConverterFactory.create())\n                .build();\n\nApiService api =\n        retrofit.create(ApiService.class);\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Making GET Request<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>Call&lt;List&lt;User&gt;&gt; call =\n        api.getUsers();\n\ncall.enqueue(new Callback&lt;List&lt;User&gt;&gt;() {\n\n    @Override\n    public void onResponse(\n            Call&lt;List&lt;User&gt;&gt; call,\n            Response&lt;List&lt;User&gt;&gt; response) {\n\n        List&lt;User&gt; users =\n                response.body();\n\n    }\n\n    @Override\n    public void onFailure(\n            Call&lt;List&lt;User&gt;&gt; call,\n            Throwable t) {\n\n    }\n\n});\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This fetches data from server asynchronously.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Sending Data Using POST<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>@POST(\"users\")\nCall&lt;User&gt; createUser(@Body User user);\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Calling POST:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>User user =\n        new User(\"Ali\", 22);\n\napi.createUser(user)\n        .enqueue(new Callback&lt;User&gt;() {\n\n    @Override\n    public void onResponse(\n            Call&lt;User&gt; call,\n            Response&lt;User&gt; response) {\n\n    }\n\n    @Override\n    public void onFailure(\n            Call&lt;User&gt; call,\n            Throwable t) {\n\n    }\n\n});\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This sends data to server.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Error Handling in APIs<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Common errors include:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>No internet connection<\/li>\n\n\n\n<li>Server not responding<\/li>\n\n\n\n<li>Wrong endpoint<\/li>\n\n\n\n<li>Invalid response format<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Example handling:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>@Override\npublic void onFailure(\n        Call&lt;List&lt;User&gt;&gt; call,\n        Throwable t) {\n\n    System.out.println(\n            \"Error: \" + t.getMessage());\n\n}\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">What is an API Endpoint?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">An endpoint is a specific URL where API requests are sent.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Examples:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\/users<\/li>\n\n\n\n<li>\/login<\/li>\n\n\n\n<li>\/products<\/li>\n\n\n\n<li>\/orders<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Each endpoint performs a specific function.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Authentication in APIs<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Many APIs require authentication.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Common methods:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">API Key<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A simple key used to access API.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Token (JWT)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A secure token used after login.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example header:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Authorization: Bearer token123\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Synchronous vs Asynchronous Calls<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Synchronous<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Blocks main thread<\/li>\n\n\n\n<li>Not recommended in Android<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Asynchronous<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Runs in background<\/li>\n\n\n\n<li>Used in Retrofit<\/li>\n\n\n\n<li>Keeps app responsive<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Real-World Applications<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">REST APIs are used in:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Social media apps<\/li>\n\n\n\n<li>E-commerce apps<\/li>\n\n\n\n<li>Food delivery apps<\/li>\n\n\n\n<li>Banking applications<\/li>\n\n\n\n<li>News applications<\/li>\n\n\n\n<li>Streaming platforms<\/li>\n\n\n\n<li>Ride booking apps<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Almost every modern app depends on APIs.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Advantages of REST API<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">REST APIs offer many benefits:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Fast communication<\/li>\n\n\n\n<li>Platform independent<\/li>\n\n\n\n<li>Scalable architecture<\/li>\n\n\n\n<li>Easy integration<\/li>\n\n\n\n<li>Lightweight data format (JSON)<\/li>\n\n\n\n<li>Works with cloud systems<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Limitations of REST API<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">REST APIs also have limitations:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Requires internet connection<\/li>\n\n\n\n<li>Depends on server availability<\/li>\n\n\n\n<li>Security concerns if not handled properly<\/li>\n\n\n\n<li>Can have latency issues<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Common Beginner Mistakes<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Wrong Base URL<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Ensure base URL ends with \u201c\/\u201d.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Not Handling Null Responses<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Always check response body.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Running Network Call on Main Thread<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Always use asynchronous calls.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Ignoring Errors<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Handle both success and failure cases.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Best Practices<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">When working with REST APIs:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use Retrofit for simplicity<\/li>\n\n\n\n<li>Handle errors properly<\/li>\n\n\n\n<li>Validate API responses<\/li>\n\n\n\n<li>Use asynchronous calls<\/li>\n\n\n\n<li>Secure API keys<\/li>\n\n\n\n<li>Optimize network usage<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">These practices improve performance and reliability.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Importance of REST API<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">REST APIs are important because they:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Connect apps with servers<\/li>\n\n\n\n<li>Enable real-time data<\/li>\n\n\n\n<li>Support cloud applications<\/li>\n\n\n\n<li>Improve scalability<\/li>\n\n\n\n<li>Allow dynamic content<\/li>\n\n\n\n<li>Power modern mobile apps<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">They are the backbone of modern Android development.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">REST APIs are a core part of Android development that enable communication between mobile applications and servers. By using HTTP methods like GET, POST, PUT, and DELETE, apps can fetch and send data in JSON format. With tools like Retrofit, developers can easily integrate APIs into Android applications and build dynamic, real-time, and scalable apps. Mastering REST APIs is essential for every modern Android developer.<\/p>\n\n\n<div class=\"yoast-breadcrumbs\"><span><span><a href=\"https:\/\/gigz.pk\/javaapp\">Home<\/a><\/span> \u00bb <span class=\"breadcrumb_last\" aria-current=\"page\">Professional App Development > APIs and Internet > REST API Basics<\/span><\/span><\/div>\n\n\n<div class=\"schema-faq wp-block-yoast-faq-block\"><\/div>\n","protected":false},"menu_order":54,"template":"","class_list":["post-162","lesson","type-lesson","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>REST API Basics - Learn Java used for Apps with GiGz.PK<\/title>\n<meta name=\"description\" content=\"Learn Android REST API basics \u2014 HTTP methods, JSON, Retrofit setup, GET and POST requests, and error handling with examples.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/gigz.pk\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"REST API Basics - Learn Java used for Apps with GiGz.PK\" \/>\n<meta property=\"og:description\" content=\"Learn Android REST API basics \u2014 HTTP methods, JSON, Retrofit setup, GET and POST requests, and error handling with examples.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/gigz.pk\/\" \/>\n<meta property=\"og:site_name\" content=\"Learn Java used for Apps with GiGz.PK\" \/>\n<meta property=\"article:modified_time\" content=\"2026-06-06T11:58:12+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":[\"WebPage\",\"FAQPage\"],\"@id\":\"https:\\\/\\\/gigz.pk\\\/javaapp\\\/?lesson=rest-api-basics\",\"url\":\"https:\\\/\\\/gigz.pk\\\/\",\"name\":\"REST API Basics - Learn Java used for Apps with GiGz.PK\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/gigz.pk\\\/javaapp\\\/#website\"},\"datePublished\":\"2026-06-03T06:41:17+00:00\",\"dateModified\":\"2026-06-06T11:58:12+00:00\",\"description\":\"Learn Android REST API basics \u2014 HTTP methods, JSON, Retrofit setup, GET and POST requests, and error handling with examples.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/gigz.pk\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/gigz.pk\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/gigz.pk\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/gigz.pk\\\/javaapp\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Professional App Development > APIs and Internet > REST API Basics\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/gigz.pk\\\/javaapp\\\/#website\",\"url\":\"https:\\\/\\\/gigz.pk\\\/javaapp\\\/\",\"name\":\"Learn Java used for Apps with GiGz.PK\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/gigz.pk\\\/javaapp\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"REST API Basics - Learn Java used for Apps with GiGz.PK","description":"Learn Android REST API basics \u2014 HTTP methods, JSON, Retrofit setup, GET and POST requests, and error handling with examples.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/gigz.pk\/","og_locale":"en_US","og_type":"article","og_title":"REST API Basics - Learn Java used for Apps with GiGz.PK","og_description":"Learn Android REST API basics \u2014 HTTP methods, JSON, Retrofit setup, GET and POST requests, and error handling with examples.","og_url":"https:\/\/gigz.pk\/","og_site_name":"Learn Java used for Apps with GiGz.PK","article_modified_time":"2026-06-06T11:58:12+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["WebPage","FAQPage"],"@id":"https:\/\/gigz.pk\/javaapp\/?lesson=rest-api-basics","url":"https:\/\/gigz.pk\/","name":"REST API Basics - Learn Java used for Apps with GiGz.PK","isPartOf":{"@id":"https:\/\/gigz.pk\/javaapp\/#website"},"datePublished":"2026-06-03T06:41:17+00:00","dateModified":"2026-06-06T11:58:12+00:00","description":"Learn Android REST API basics \u2014 HTTP methods, JSON, Retrofit setup, GET and POST requests, and error handling with examples.","breadcrumb":{"@id":"https:\/\/gigz.pk\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/gigz.pk\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/gigz.pk\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/gigz.pk\/javaapp"},{"@type":"ListItem","position":2,"name":"Professional App Development > APIs and Internet > REST API Basics"}]},{"@type":"WebSite","@id":"https:\/\/gigz.pk\/javaapp\/#website","url":"https:\/\/gigz.pk\/javaapp\/","name":"Learn Java used for Apps with GiGz.PK","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/gigz.pk\/javaapp\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/gigz.pk\/javaapp\/index.php?rest_route=\/wp\/v2\/lesson\/162","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gigz.pk\/javaapp\/index.php?rest_route=\/wp\/v2\/lesson"}],"about":[{"href":"https:\/\/gigz.pk\/javaapp\/index.php?rest_route=\/wp\/v2\/types\/lesson"}],"wp:attachment":[{"href":"https:\/\/gigz.pk\/javaapp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=162"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}