Indy IdHTTP->Post Sorunu

C, C++ ve C++ Builder ile ilgili konuları buraya yazabilirsiniz.
Cevapla
theSinan

Indy IdHTTP->Post Sorunu

Mesaj gönderen theSinan »

S.a

Indy Bileşenlerinde
IdHTTP ile Post işlemi yapmak istiyorum
post ile gönderdiğim bilgiler gitmiyor
Get ile Gönderebiliyorum

Kod: Tümünü seç


	String HttpPost()
			{

	TStringStream *Parametre= new TStringStream;
	String sMesajSorguCevab;
	Parametre->WriteString("kullanici=adimiz&sifre=Sifrem&islem_tipi=post_testi");
			try{
			sMesajSorguCevab = Form1->IdHTTP1->Post( "http://www.xn--kardelerbilgisayar-hqd.com.tr/components/com_kardesler_mesaj/views/mesaj/tmpl/index.php" , Parametre);
			}catch(Exception *e)
			{
			Application->ShowException(e);

			}

		return  sMesajSorguCevab;
	}
gelen degeri

Kod: Tümünü seç

Memo1->Text = HttpPost();
Memoya Alıyorum

index.php dosyasını içeriği sadece post veya GET Bilgilerini Göstermek
işte Php kodu

Kod: Tümünü seç

<?php
print "Post BİLGİLERİ";
print_r($_POST);
print "<hr>GET BİLGİLERİ";
print_r($_GET);
?>
ben Bilgileri Pos ile Göndermem Gerekiyor
ama çalışmıyor

Kod: Tümünü seç

sMesajSorguCevab = Form1->IdHTTP1->Post( "http://www.xn--kardelerbilgisayar-hqd.com.tr/components/com_kardesler_mesaj/views/mesaj/tmpl/index.php" , Parametre);
satırını

Kod: Tümünü seç

sMesajSorguCevab = Form1->IdHTTP1->Post( "http://www.xn--kardelerbilgisayar-hqd.com.tr/components/com_kardesler_mesaj/views/mesaj/tmpl/index.php?kullanici=adimiz&sifre=Sifrem&islem_tipi=post_testi" , Parametre);
yaptığımda GEt ile Bilgileri Gittiğini Görüyorum
Peki POST neden Yapamıyorum
Parametre değişkeninin
UtfToEncode yaptığımda

Kod: Tümünü seç

[bcc32 Error] Unit1.cpp(28): E2285 Could not find a match for 'UTF8Encode(TStringStream *)'
 
hatası alıyorum
bilgileri Nasıl Post ile Gönderebilirim acaba
theSinan

Re: Indy IdHTTP->Post Sorunu

Mesaj gönderen theSinan »

Kod: Tümünü seç

TStringStream *Parametre= new TStringStream; 
yerine

Kod: Tümünü seç

TStringList *liste = new TStringList ;

Kod: Tümünü seç

Parametre->WriteString("kullanici=adimiz&sifre=Sifrem&islem_tipi=post_testi");
yerine

Kod: Tümünü seç

liste->Add("kullanici=adimiz");
liste->Add("sifre=Sifrem");
liste->Add("islem_tipi=post_testi");
yapınca çözüldü
Cevapla