프로그래밍/Delphi
TIdHTTP.Post로 질의 및 결과 받기
낭만온달
2009. 11. 4. 09:35
- var
- rbstr: RawByteString;
- HTML: String;
- MemoryStream: TMemoryStream;
- StringStream: TStringStream;
- slPost: TStringList;
- begin
- slPost := TStringList.Create;
- slPost.Add('student_info=박지훈');
- slPost.Add('reserve_purpose=임프');
- StringStream := TStringStream.Create(slPost.Text);
- slPost.Free;
-
- MemoryStream := TMemoryStream.Create;
- IdHTTP1.Post('http://주소', StringStream, MemoryStream);
- StringStream.Free;
-
- rbstr := PAnsiChar(MemoryStream.Memory);
- MemoryStream.Free;
-
- if Pos('utf-8', IdHTTP1.Response.ContentType)=0 then
- SetCodePage(rbstr, 949, false)
- else
- SetCodePage(rbstr, 65001, false);
- Memo1.Lines.Text := rbstr;
- end;
'프로그래밍/Delphi' Related Articles