Skip to content

estel1997/Study_Code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Study_Code

Swift で API 通信の基礎を学ぶための学習ログ repo です。完成アプリではなく、URLURLComponentsURLRequest、HTTP method、header、JSON decode などを小さなファイルに分けて確認しています。

この repo の目的

  • Swift の URL 型を理解する
  • URLComponents で query parameter を安全に組み立てる
  • URLRequest の役割を理解する
  • HTTP method / header / timeout の基礎を整理する
  • API 通信の流れを説明できるようにする

学習テーマ一覧

File Theme
Study1_URL.swift URL と absolute / relative URL
Study2_URLComponents.swift URLComponents と query item
Study3_URLRequest.swift URLRequest と HTTP request の基礎

API 通信の流れ

URL
  -> URLComponents
  -> URLRequest
  -> URLSession
  -> Response
  -> JSONDecoder
  -> Model
  -> ViewModel / View

詳しくは docs/api-learning-map.md を参照してください。

学んだこと

  • URL は文字列ではなく型として扱うと安全になる
  • query parameter は文字列結合ではなく URLComponents で組み立てる
  • URLRequest は method、header、timeout など request の設定を持つ
  • API 通信は URL 作成、request 作成、通信、response 確認、decode に分けて考えると理解しやすい...など

注意事項

この repo は Swift API 通信の学習用です。

About

Swift API learning notes covering URL, URLComponents, URLRequest, JSONDecoder, and HTTP basics.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages