1. °³¹ß/½ÇÇà Ç÷§Æû
(1) OS :
(2) °³¹ßÅø :
(3) »ç¿ë Database :
2. °³¹ß ÁßÀÎ ÇÁ·Î±×·¥
3. Áú¹® ³»¿ë
¾È³çÇϼ¼¿ä ÇöÀç µ¨ÆÄÀÌ7 indy10 »ç¿ëÁßÀÌ°í ÀÌÄ«¿îÆ® open api ¸¦ ¿¬µ¿ÇÏ·Á°í ÇÕ´Ï´Ù
POST¹æ½ÄÀ¸·Î ¿äû½Ã¿¡ ÀÀ´äÀº ¿À±ä¿À´Âµ¥ ¿¡·¯ÀÀ´äÀÌ ¿Í¼ ¿äûµ¥ÀÌŸ°¡ ¹®Á¦ÀΰŠ°°Àºµ¥ ¹«¾úÀÎÁö
¸øã¾Æ¼ ´ä´äÇÕ´Ï´Ù ¤Ì¤Ì
procedure TForm1.btn1Click(Sender: TObject);
var sUrl: Widestring;
Code, searchword,result_type : AnsiString;
Data, DResult : TStringStream;
i,j, nTotCnt, k: integer;
sData: TStringList;
ssIOHandler : TIdSSLIOHandlerSocketOpenSSL;
begin
Data := TStringStream.Create('');
sData := TStringList.Create;
DResult := TStringStream.Create('');
idhtp1.Create;
ssIOHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil);
ssIOHandler.SSLOptions.Method := sslvSSLv23;
ssIOHandler.SSLOptions.Mode := sslmClient;
idhtp1.IOHandler := ssIOHandler;
try
Code := HTTPEncode(UTF8Encode('601879')); //ȸ»çÄÚµå
sUrl := 'https://oapi.ecounterp.com/OAPI/V2/Zone'; //API ¿äû URL
idhtp1.Request.Referer := 'https://oapi.ecounterp.com/OAPI/V2/Zone';
idhtp1.Request.Host := sUrl;
idhtp1.HTTPOptions := [];
sData.Add('COM_CODE:'+Code); // µ¥ÀÌÅÍ
idhtp1.Request.ContentType := 'application/json;';
try
idhtp1.Post(sUrl, sData, DResult);
except
mmo1.Lines.Add(idhtp1.ResponseText); //ÀÀ´ä
end;
finally
mmo1.Lines.Add('Å©±â'+ IntToStr(DResult.Size));
mmo1.Lines.Add(DResult.DataString);
ssIOHandler.Free;
DResult.Free;
sData.Free;
Data.Free;
end;
ÀÌ·¸°Ô º¸³ÂÀ»½Ã ÀÀ´äÀº
'invalid argument to date encode' ¿¡·¯³ª°í ¿©±â¼ ´Ù½Ã ½ÇÇà ½ÃÅ°¸é
Å©±â294
{"Status":"500","Errors":[{"ProgramId":"",
"Name":"",
"Code":"EXP00001",
"Message":"Unsupported Media Type",
"Param":null}],
"Error":{
"Code":0,
"Message":"Unsupported Media Type",
"MessageDetail":""
},
"Timestamp":null,
"RequestKey":null,
"IsEnableNoL4":false,
"RefreshTimestamp":"0",
"AsyncActionKey":null}
ÀÌ·¸°Ô ÀÀ´äÀº ¿À´Âµ¥ ¿¡·¯°¡ ¹ºÁö ¸ð¸£°Ú¾î¿ä ¤Ð¤Ð