Open yoogail105 opened 2 years ago
JSON
단점
JSON
집합 구조
: JSON 객체, {}
리스트 구조
: JSON 배열, []
{ 키: 데이터 }
{ "name": "wonwoo",
"Description": "게임 잘함",
"age": 26,
"thumbnail": "wonwoo.jpg"
}
단점
{ "name": "wonwoo",
"Description": {
"game": 8,
"sing": 10,
"dance": 10
},
"age": 26,
"thumbnail": "wonwoo.jpg"
}
장점
Swift
: 키-값을 제공하는 자료 구조는 Dictionary
Description
은 실수 타입이므로 Dictionary에 저장 불가
아이템
[
{ "name": "wonwoo",
"Description": {
"game": 8,
"sing": 10,
"dance": 10
},
"age": 26,
"thumbnail": "wonwoo.jpg"
},
{ "name": "dino",
"Description": {
"game": 5,
"sing": 10,
"dance": 10
},
"age": 25,
"thumbnail": "dino.jpg"
}
]
{
"ListTotalCount": 2,
"group": "seventeen",
"row": [
{ "name": "wonwoo",
"Description": {
"game": 8,
"sing": 10,
"dance": 10
},
"age": 26,
"thumbnail": "wonwoo.jpg"
},
{ "name": "dino",
"Description": {
"game": 5,
"sing": 10,
"dance": 10
},
"age": 25,
"thumbnail": "dino.jpg"
}
]
}
XML, JSON
알고 있어야 하는 것들
SOAP
과RESTful
방식으로 나뉜다. #61지금 이야기할 것
웹서비스 데이터 타입에 따라1:
XML
XML: Extensible Markup Language
<
로 시작 →>
로 끝나는 구조<element>
<element>
<element/>
Foundation
프레임워크에서XMLParser
라는 모듈 제공🔖 출처