CodeGym
AI Academy
Promotion
CodeGym University
Learning
Courses
Tasks
Surveys & Quizzes
Games
Help
Schedule
Community
Users
Forum
Chat
Articles
Success stories
Activity
Reviews
Subscriptions
Light theme

Lessons

  • Reviews
  • About us
Start
Start learning
Start learning now
  • My Progress
  • Courses
  • University
  • Quest Map
  • Lessons
  • Getting to Know HTTP

    Kotlin SELF
    Level 58, Lesson 0
    We break down the basics of HTTP as a “contract” between a client and a server: the request → response pair, the structure of a URL and the concept of an endpoint, the meaning of GET/ POST methods, the role of Accept and Content-Type headers, working with status codes ( 2xx/ 4xx/ 5xx), and the discipline of handling a response “status first, body second” — with Kotlin mini-examples and common mistakes.
    Available
  • Ktor Client “without magic”: HttpClient, HttpResponse, bodyAsText()

    Kotlin SELF
    Level 58, Lesson 1
    We break down Ktor Client “without magic”: why you should reuse and always close HttpClient, how to get the “raw” HttpResponse, check status, and read the body via bodyAsText(). Step by step, we assemble a minimal client on the CIO engine, show the runBlocking bridge for the console, refactor into suspend functions, and fix typical mistakes in network calls.
    Available
  • JSON integration in Ktor: ContentNegotiation and kotlinx.serialization

    Kotlin SELF
    Level 58, Lesson 2
    We’re breaking down “grown-up” JSON work in Ktor: how to connect the ContentNegotiation plugin and serialization based on kotlinx.serialization, how to describe models via @Serializable, read responses as types via response.body<T>(), send JSON via setBody(...), and not forget about Content-Type. Separately, we’ll lock in practical settings like ignoreUnknownKeys and common mistakes (reading the body twice, JSON/model mismatch, etc.).
    Available
  • Errors and resilience: non‑2xx vs exceptions, timeouts

    Kotlin SELF
    Level 58, Lesson 3
    We break down resilience in network code with Kotlin and Ktor: how “the server replied but the status is non‑2xx” differs from “there was no reply and an exception was thrown”, why you check status first and only then read the body, how to set timeouts via HttpTimeout, and how to return the result as a value (via a sealed model ApiResult) instead of println inside catch. At the end — a limited retry with a pause and a list of typical mistakes.
    Available
  • Client and scenario architecture: no “network in the CLI”

    Kotlin SELF
    Level 58, Lesson 4
    We’re going over a simple learning architecture where CLI is responsible only for input/output, scenarios (use cases) turn network results into “human meaning”, and the network client hides HTTP/JSON details behind the TipsApi contract. We introduce an explicit result type ApiResult<T>, show an implementation using Ktor ( HttpClient), assemble dependencies in AppContext (composition root), and extend functionality (the ping endpoint) without “edits across the whole project”.
    Available
Learn
  • Registration
  • Java Course
  • Help with Tasks
  • Pricing
  • Java Syntax
Community
  • Users
  • Articles
  • Forum
  • Chat
  • Success Stories
  • Activity
  • Affiliate Program
Company
  • About us
  • Contacts
  • Reviews
  • Press Room
  • CodeGym for EDU
  • FAQ
  • Support
CodeGym CodeGym is an online course for learning Java programming from scratch. This course is a perfect way to master Java for beginners. It contains 1200+ tasks with instant verification and an essential scope of Java fundamentals theory. To help you succeed in education, we’ve implemented a set of motivational features: quizzes, coding projects, content about efficient learning, and a Java developer’s career.
Follow us
Interface language
English
Deutsch Español हिन्दी Français Português Polski বাংলা 简体中文 मराठी தமிழ் Italiano Bahasa Indonesia 繁體中文 Nederlands 日本語 한국어 Bulgarian Danish Hungarian Basa Jawa Malay Norwegian Romanian Swedish Telugu Thai Українська Filipino Turkish Azərbaycan Русский Vietnamese
Programmers Are Made, Not Born © 2026 CodeGym
MastercardVisa
Programmers Are Made, Not Born © 2026 CodeGym