Board index » delphi » Indy http post
BOBAH
![]() Delphi Developer |
Sun, 20 Nov 2005 02:25:13 GMT
|
BOBAH
![]() Delphi Developer |
Sun, 20 Nov 2005 02:25:13 GMT
Indy http post
Hi all!
Have few questions. 1. As I can see from help Multipart form content for the stream can include values for the HTML INPUT types: CHECKBOX should I describe input type in AddField? Indy 9.0.11+BCB6 Thanks for any advice |
Team
![]() Delphi Developer |
Sun, 20 Nov 2005 02:42:10 GMT
Re:Indy http postQuote"BOBAH" <bo...@softhome.net> wrote in message Quote> should I describe input type in AddField? include type names as well. Quote> 3. I'm trying post to site which require some generating the error? Gambit |
BOBA
![]() Delphi Developer |
Sun, 20 Nov 2005 02:50:00 GMT
Re:Indy http postAnsiString url; TIdMultiPartFormDataStream *req=new TIdMultiPartFormDataStream; IdHTTP1->Request->ContentType=req->RequestContentType; req->AddFormField("FileType","SDF"); req->AddFormField("checkbox2","N"); req->AddFormField("ListingProgram","sss"); req->AddFormField("checkbox","Y"); - I hope that's enough ti make checkbox checked req->AddFormField("FType","PR"); req->AddFile("UploadFileName","c:\\t01.txt","file"); req->Position=0; url="https://"; thanks Quote"BOBAH" <bo...@softhome.net> wrote in message Quote> should I describe input type in AddField? include type names as well. Quote> 3. I'm trying post to site which require some generating the error? Gambit |
Team
![]() Delphi Developer |
Sun, 20 Nov 2005 02:58:31 GMT
Re:Indy http postQuote"BOBAH" <bo...@softhome.net> wrote in message Quote> req->AddFormField("checkbox","Y"); - I hope and values that you supply to AddFormField() must match the exact values from the HTML. Gambit |
BOBA
![]() Delphi Developer |
Sun, 20 Nov 2005 03:05:25 GMT
Re:Indy http posthere is page <form method="POST" enctype="multipart/form-data" <input type=hidden name=customer_id value=""> <select name="FileType"> <input type="checkbox" name="checkbox2" value="Y"> <input type="radio" name="ListingProgram" value="Ppp">only<br> <input type="checkbox" name="checkbox" value="Y"> <select name="FType"> <input type=image src=https://ssl-images.gif width=80 height=20 border=0> </form> "Remy Lebeau (TeamB)" <gambi...@yahoo.com> wrote in message Quote"BOBAH" <bo...@softhome.net> wrote in message Quote> req->AddFormField("checkbox","Y"); - I hope and values that you supply to AddFormField() must match the exact values from the HTML. Gambit |
Team
![]() Delphi Developer |
Sun, 20 Nov 2005 04:38:37 GMT
Re:Indy http postQuote"BOBAH" <bo...@softhome.net> wrote in message Quote> here is page TIdMultiPartFormDataStream *req = new TIdMultiPartFormDataStream; reg->AddFormField("customer_id", ""); // tweak this URL to suit your actual needs... IdHTTP1->Post(url, req); The biggest difference I see in this code over your original code is that Gambit |
BOBA
![]() Delphi Developer |
Sun, 20 Nov 2005 05:13:19 GMT
Re:Indy http postyeah, actually I'm using real URL, code just has not full URL. anyway I still have that error even after changes (2 errors in AddFormField) Thanks "Remy Lebeau (TeamB)" <gambi...@yahoo.com> wrote in message news:3edd0695$1@newsgroups.borland.com... Quote"BOBAH" <bo...@softhome.net> wrote in message Quote> here is page TIdMultiPartFormDataStream *req = new TIdMultiPartFormDataStream; reg->AddFormField("customer_id", ""); // tweak this URL to suit your actual needs... IdHTTP1->Post(url, req); The biggest difference I see in this code over your original code is that Gambit |
Team
![]() Delphi Developer |
Sun, 20 Nov 2005 05:50:43 GMT
Re:Indy http postQuote"BOBAH" <bo...@softhome.net> wrote in message Quote> yeah, actually I'm using real URL, code just has not then post the EXACT copy/pasted source code. Gambit |
BOBA
![]() Delphi Developer |
Sun, 20 Nov 2005 21:48:37 GMT
Re:Indy http postSent via mail "Remy Lebeau (TeamB)" <gambi...@yahoo.com> wrote in message Quote"BOBAH" <bo...@softhome.net> wrote in message Quote> yeah, actually I'm using real URL, code just has not then post the EXACT copy/pasted source code. Gambit |
Team
![]() Delphi Developer |
Mon, 21 Nov 2005 03:15:21 GMT
Re:Indy http postQuote"BOBAH" <bo...@softhome.net> wrote in message Quote> Sent via mail good to this group when emailed privately. Gambit |
BOBA
![]() Delphi Developer |
Mon, 21 Nov 2005 03:22:06 GMT
Re:Indy http postvoid __fastcall TForm1::Button1Click(TObject *Sender) { AnsiString url,url1; TIdMultiPartFormDataStream *req=new TIdMultiPartFormDataStream; IdHTTP1->Request->ContentType=req->RequestContentType; req->AddFormField("customer_id",""); req->AddFormField("FileType","TabDelimitedBooks"); req->AddFormField("enable-expedited-shipping",""); req->AddFormField("ListingProgram","PureSDP"); req->AddFormField("asinate","Y"); req->AddFormField("FileOperationType","PR"); req->AddFile("UploadFileName","c:\\booklist01.txt","file"); req->Position=0; url="https://secure.amazon.com/exec/panama/seller-admin/catalog-upload/catal Quote} <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> <html> .serif { font-family: times,serif; font-size: small; } --></style> <title> </title> </head> <body bgcolor="#FFFFFF" link="#003399" alink="#FF9933" vlink="#996633" <img src="https://ssl-images.amazon.com/images/G/04/icons/amazon-logo.gif" <br><br> <table border=0 cellspacing=0 cellpadding=0> <td valign=middle> Book Deli</a> > <a > <b class="h1">Upload Your Book File Now</b><br> </font> <font face=verdana,arial,helvetica size=-2> (If you are not Book Deli, <a <p> <img src="https://ssl-images.amazon.com/images/G/04/icons/orange-arrow.gif" <a href=http://www.amazon.com/exec/obidos/tg/browse/-/562160/>Click here to </p> <tr> <tr><td align=right width=33% valign=top> <input type="checkbox" name="enable-expedited-shipping" value="Y"> Enable expedited shipping for all listings in this upload--UIEE Sellers </td></tr> <tr><td align=right width=33% valign=top> <p> Assign ISBNs automatically for listing in Marketplace (<a <p> <tr><td align=right width=33% valign=top> <tr> Amazon Payments<br> Money-Order/Cashier's Check<br> Personal check<br> </td></tr> No </td></tr> Buyer Pays </td></tr> 90025, </td></tr> N/A </td></tr> <tr align="center"> <input type=image </td> <br clear="all"> <br> <a href="http://www.amazon.com/exec/obidos/tg/browse/-/508088/">Conditions © 1996-2002 </center> "Remy Lebeau (TeamB)" <gambi...@yahoo.com> wrote in message Quote"BOBAH" <bo...@softhome.net> wrote in message Quote> Sent via mail good to this group when emailed privately. Gambit |
BOBA
![]() Delphi Developer |
Mon, 21 Nov 2005 03:24:58 GMT
Re:Indy http postyeah in Request few parameters like username, password, basicauthentication=true Quote"BOBAH" <bo...@softhome.net> wrote in message void __fastcall TForm1::Button1Click(TObject *Sender) { AnsiString url,url1; TIdMultiPartFormDataStream *req=new TIdMultiPartFormDataStream; IdHTTP1->Request->ContentType=req->RequestContentType; req->AddFormField("customer_id",""); req->AddFormField("FileType","TabDelimitedBooks"); req->AddFormField("enable-expedited-shipping",""); req->AddFormField("ListingProgram","PureSDP"); req->AddFormField("asinate","Y"); req->AddFormField("FileOperationType","PR"); req->AddFile("UploadFileName","c:\\booklist01.txt","file"); req->Position=0; url="https://secure.amazon.com/exec/panama/seller-admin/catalog-upload/catal Quote} <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> <html> .serif { font-family: times,serif; font-size: small; } --></style> <title> </title> </head> <body bgcolor="#FFFFFF" link="#003399" alink="#FF9933" vlink="#996633" <img src="https://ssl-images.amazon.com/images/G/04/icons/amazon-logo.gif" <br><br> <table border=0 cellspacing=0 cellpadding=0> <td valign=middle> Book Deli</a> > <a > <b class="h1">Upload Your Book File Now</b><br> </font> <font face=verdana,arial,helvetica size=-2> (If you are not Book Deli, <a <p> <img src="https://ssl-images.amazon.com/images/G/04/icons/orange-arrow.gif" <a href=http://www.amazon.com/exec/obidos/tg/browse/-/562160/>Click here to </p> <tr> <tr><td align=right width=33% valign=top> <input type="checkbox" name="enable-expedited-shipping" value="Y"> Enable expedited shipping for all listings in this upload--UIEE Sellers </td></tr> <tr><td align=right width=33% valign=top> <p> Assign ISBNs automatically for listing in Marketplace (<a <p> <tr><td align=right width=33% valign=top> <tr> Amazon Payments<br> Money-Order/Cashier's Check<br> Personal check<br> </td></tr> No </td></tr> Buyer Pays </td></tr> 90025, </td></tr> N/A </td></tr> <tr align="center"> <input type=image </td> <br clear="all"> <br> <a href="http://www.amazon.com/exec/obidos/tg/browse/-/508088/">Conditions © 1996-2002 </center> "Remy Lebeau (TeamB)" <gambi...@yahoo.com> wrote in message Quote"BOBAH" <bo...@softhome.net> wrote in message Quote> Sent via mail good to this group when emailed privately. Gambit |