MIME 타입이란 클라이언트에게 전송된 문서의 다양성을 알려주기 위한 메커니즘입니다: 웹에서 파일의 확장자는 별 의미가 없습니다. 그러므로, 각 문서와 함께 올바른 MIME 타입을 전송하도록, 서버가 정확히 설정하는 것이 중요합니다. 브라우저들은 리소스를 내려받았을 때 해야 할 기본 동작이 무엇인지를 결정하기 위해 대게 MIME 타입을 사용합니다.
https://developer.mozilla.org/ko/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types
JavaScript Object Notation (JSON)은 Javascript 객체 문법으로 구조화된 데이터를 표현하기 위한 문자 기반의 표준 포맷입니다. 웹 어플리케이션에서 데이터를 전송할 때 일반적으로 사용합니다(서버에서 클라이언트로 데이터를 전송하여 표현하려거나 반대의 경우)
let transaction = {
id:6,
gubun:"입금",
sender:"ATM",
reciver:1111,
amount:100,
createdAt:"2023-01-08 12:13:40"
}
public class Transaction {
Long id=6;
String gubun="입금";
String sender="ATM";
String reciver=1111;
Long amount=100;
String createdAt="2023-01-08 12:13:40";
}
{
"id":6,
"gubun":"입금",
"sender":"ATM",
"reciver":1111,
"amount":100,
"createdAt":"2023-01-08 12:13:40"
}
<transaction>
<id>6</id>
<gubun>입금</gubun>
<sender>ATM</sender>
<reciver>1111</reciver>
<amount>100</amount>
<createdAt>2023-01-08 12:13:40</createdAt>
</transaction>
id: 6
gubun: 입금
sender: ATM
reciver: 1111
amount: 100
createdAt: 2023-01-08 12:13:40
https://mvnrepository.com/artifact/com.google.code.gson/gson/2.10.1
https://blog.naver.com/getinthere/223009231524
https://github.com/codingspecialist/socket-study.git
class Data {
private String title;
private String content;
}
요청에 따라, 파싱하여 응답하는 소켓 서버를 구현하라. 반이중으로 구현하고, 멀티쓰레드 프로세스가 되어야 한다