...
This commit is contained in:
@@ -2,7 +2,10 @@ package network
|
||||
|
||||
import io.ktor.client.*
|
||||
import io.ktor.client.request.*
|
||||
import io.ktor.client.request.forms.FormDataContent
|
||||
import io.ktor.client.statement.*
|
||||
import io.ktor.http.HttpHeaders
|
||||
import io.ktor.http.Parameters
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.json.Json
|
||||
import model.KisSession
|
||||
@@ -65,6 +68,37 @@ object DartCodeManager {
|
||||
}
|
||||
}
|
||||
|
||||
// suspend fun fetchKrxData(client: HttpClient) {
|
||||
// val url = "https://data.krx.co.kr/comm/bldAttendant/getJsonData.cmd"
|
||||
//
|
||||
// val response: HttpResponse = client.post(url) {
|
||||
// // Headers 설정
|
||||
// header(HttpHeaders.Accept, "application/json, text/javascript, */*; q=0.01")
|
||||
// header(HttpHeaders.AcceptLanguage, "en-US,en;q=0.9,ko-KR;q=0.8,ko;q=0.7")
|
||||
// header("X-Requested-With", "XMLHttpRequest")
|
||||
// header(HttpHeaders.Referrer, "https://data.krx.co.kr/contents/MDC/MDI/mdiLoader/index.cmd?menuId=MDC0302")
|
||||
// header(HttpHeaders.UserAgent, "Mozilla/5.0 (Linux; Android) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Mobile Safari/537.36")
|
||||
//
|
||||
// // Body 설정 (application/x-www-form-urlencoded)
|
||||
// setBody(FormDataContent(Parameters.build {
|
||||
// append("bld", "dbms/MDC/EASY/ranking/MDCEASY01601")
|
||||
// append("locale", "ko_KR")
|
||||
// append("mktId", "ALL")
|
||||
// append("itmTpCd3", "2")
|
||||
// append("itmTpCd2", "1")
|
||||
// append("strtDd", "20250402")
|
||||
// append("endDd", "20260402")
|
||||
// append("stkprcTpCd", "Y")
|
||||
// append("share", "1")
|
||||
// append("money", "1")
|
||||
// append("csvxls_isNo", "false")
|
||||
// }))
|
||||
// }
|
||||
//
|
||||
// val responseBody = response.bodyAsText()
|
||||
// println(responseBody)
|
||||
// }
|
||||
|
||||
/**
|
||||
* 앱 실행 시 호출하여 매핑 테이블 업데이트
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user