I.T. Discussion Community!
-Collapse +Expand
Delphi
Search Delphi Group:

Advanced
-Collapse +Expand Delphi To/From
To/FromCODEGuides
-Collapse +Expand Delphi Store
PRESTWOODSTORE

Prestwood eMagazine

October Edition
Subscribe now! It's Free!
Enter your email:

   ► MB LobbyPascal and Delphi Coding BoardDelphi VCL Topic   Print This     

NMHTTP Post Message Problem

NMHTTP Post Message Problem in Delphi VCL topic (part of our Pascal and Delphi Coding group).

Quick Search: Message   Problem   NMHTTP Post   NMHTTP Post Message  
sharkboo
 (Inactive)
hangzhou,China
when i use NMHTTP1.Post('http://10.0.65.188/hello.php','a=hello'),the socket reply that the connection is successful,but the parameter hasn't been transfered.

who know why and how to deal with it?
thax.
 Posted 18 years ago (Thread Starter)
Comment Quote
About sharkboo -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #3094, 9 reply
Thread Started 7/30/2001 7:51:00 PM
View Counter=37838
Last Reply Posted 6/4/2012 2:51:10 AM)
Location=hangzhou,China  
Joined=18 years ago   MB Posts=5  
sharkboo
 (Inactive)
hangzhou,China
'cause NMHTTP's post method must set the transfer parameters.such as HOST,KEEP-ALIVE...,etc.And im sure ur programm should have enough parameters been set.ok,pls try again,and if u have other question,pls check the rfc file about the HTTP subject.
good luck!
 Posted 18 years ago (Thread Starter)
Comment Quote
About sharkboo -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #4018 (Level 1.1)  Reply to 3094
Thread Started 10/9/2001 8:28:00 PM
View Counter=2
Location=hangzhou,China  
Joined=18 years ago   MB Posts=5  
sharkboo
 (Inactive)
hangzhou,China
im sure if u go to
Old UBB Archived Link: [URL=http://www.ietf.org/rfc]www.ietf.org/rfc[/URL]
and type the rfc's number 2045 ,u will get the details about HTTP1.1.And in your NMHTTP info with post method,i think u should set the parameters correctly.if u do this,maybe ur question will be OK.
 Posted 18 years ago (Thread Starter)
Comment Quote
About sharkboo -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #4031 (Level 1.2)  Reply to 3094
Reply Posted 10/10/2001 5:56:00 PM
Location=hangzhou,China  
Joined=18 years ago   MB Posts=5  
sharkboo
 (Inactive)
hangzhou,China
and then,i will give u some example that i have used before.just like this:


NMHTTP1.Host:=sServer;
NMHTTP1.Port:=iPort;
NMHTTP1.Connect;
NMHTTP1.Write('POST /ucp/eme/function/terminal/xmlparse/test.php HTTP/1.1'+#13#10);
NMHTTP1.Write('Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, */*'+#13#10);
NMHTTP1.Write('Referer:
Old UBB Archived Link: [URL=http://'+sServer+'/ucp/eme/function/terminal/xmlparse/test.php'+#13#10);]http://'+sServer+'/ucp/eme/function/terminal/xmlparse/test.php'+#13#10);[/URL]

NMHTTP1.Write('Accept-Language: en-us'+#13#10);
NMHTTP1.Write('Content-Type: application/x-www-form-urlencoded'+#13#10);
NMHTTP1.Write('Accept-Encoding: gzip, deflate'+#13#10);
NMHTTP1.Write('User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)'+#13#10);
NMHTTP1.Write('Host: '+sServer+':'+inttostr(iPort)+#13#10);
NMHTTP1.Write('Content-Length: '+inttostr(length(s))+#13#10);
//showmessage(inttostr(length(s)));
NMHTTP1.Write('Connection: close'+#13#10+#13#10);
NMHTTP1.Write(s);
recv:=NMHTTP1.Read(350);
showmessage(recv);
NMHTTP1.Disconnect;
 Posted 18 years ago (Thread Starter)
Comment Quote
About sharkboo -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #4032 (Level 1.3)  Reply to 3094
Reply Posted 10/10/2001 6:00:00 PM
Location=hangzhou,China  
Joined=18 years ago   MB Posts=5  
imdelta
 (Inactive)
-- USA
i have a problem


Username:
Password:



i submit the correct username & password,
the web can return correct web page
but i use
NMHTTP.Post('http://login.tencent.com/login" method=post','u=****&p=****&u1=http://bbs.tencent.com/cgi-bin/club_first')
to submit
NMHTTP.body cant't return correct information,why?
Please help me,thanks!
 Posted 18 years ago
Comment Quote
About imdelta -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #4017 (Level 1.4)  Reply to 3094
Reply Posted 10/9/2001 7:36:00 PM
Location=-- USA 
Joined=18 years ago   MB Posts=4  
imdelta
 (Inactive)
-- USA
Thanks for your answer!
but how can i get the correct transfer parameters,and where can i get the rfc file about the HTTP subject ?
i'm sorry to make trouble with you,thank you once more !
 Posted 18 years ago
Comment Quote
About imdelta -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #4019 (Level 1.5)  Reply to 3094
Reply Posted 10/10/2001 2:27:00 AM
Location=-- USA 
Joined=18 years ago   MB Posts=4  
imdelta
 (Inactive)
-- USA
Thank you very much.
Now I use ICS's HTTPCLI instead of NMHTTP, it is easier to use !
 Posted 18 years ago
Comment Quote
About imdelta -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #4102 (Level 1.6)  Reply to 3094
Reply Posted 10/18/2001 6:49:00 PM
Location=-- USA 
Joined=18 years ago   MB Posts=4  
Kim Berry
Prestwood IT
Citrus Heights, CA USA
Hi,

I recall reading there was a bug in earlier versions, requiring that Post params be sent in a separate file (OutputFileMode=true). But I have the following code working for me in Delphi5, so your code appears correct:

 
if MethodStr = 'GET' then //Perform a GET to Server
begin
if Length(QueryStr) > 0 then
ServerPath := Trim(ServerPath + '?' + QueryStr);
NMHTTP1.Get(ServerPath);
end
else if MethodStr = 'POST' then //Perform a POST to Server
begin
NMHTTP1.Post(ServerPath, QueryStr);
end



Try posting to the following URL to get more visibility (needed to modify the html):


[FORM METHOD="POST"
ACTION="http://www.kimberry.com/cgi-bin/echo.cgi"]
[input type=submit]
[/form]


Pardon the pop-ups. First get the above working then try the same from nmhttp.post()

Kim Berry
Old UBB Archived Link: [URL=http://www.prestwood.com]www.prestwood.com[/URL]

--
Kim Berry
Senior Programmer Analyst

 Posted 18 years ago
Comment Quote
About Kim Berry -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.
About Kim Berry

Kim Berry is an experienced coder currently specializing in VS.Net C# coding of WinForm and WebForm applications. Kim currently works part time for Prestwood IT Solutions and participates in this online community when time allows. Kim worked fulltime at Prestwood Software for four years and is still available for part time evenings and weekends work. He was one of the main Prestwood developers developing ASPSuite and has coded in many languages including C, Visual Basic, Delphi, and Visual Studio.Net.


Post ID #3197 (Level 1.7)  Reply to 3094
Reply Posted 8/2/2001 10:04:00 AM
Location=Citrus Heights, CA USA 
Joined=17 years ago   MB Posts=65   KB Posts=19   BLOG, Topics=4  
Kim Berry
Prestwood IT
Citrus Heights, CA USA
Attempting to post the post again. I post with actual html. maybe view source to see it:

  




--
Kim Berry
Senior Programmer Analyst

 Posted 18 years ago
Comment Quote
About Kim Berry -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.
About Kim Berry

Kim Berry is an experienced coder currently specializing in VS.Net C# coding of WinForm and WebForm applications. Kim currently works part time for Prestwood IT Solutions and participates in this online community when time allows. Kim worked fulltime at Prestwood Software for four years and is still available for part time evenings and weekends work. He was one of the main Prestwood developers developing ASPSuite and has coded in many languages including C, Visual Basic, Delphi, and Visual Studio.Net.


Post ID #3198 (Level 1.8)  Reply to 3094
Reply Posted 8/2/2001 10:07:00 AM
Location=Citrus Heights, CA USA 
Joined=17 years ago   MB Posts=65   KB Posts=19   BLOG, Topics=4  
Most Recent Post
Anonymous Post

La sacoche en cuir pour homme est nanmoins ce qu'on a invent de plus pratique pour les hommes et de plus moderne aussi.Et quand vous prenez les sacs dans une couleur commune partir de diffrentes collections Sac Longchamp, vous pouvez galement obtenir de l'amusement et quelques superbes descries.?Les voyages vers l'Inde ont augment de 33 pour cent et voyages au Mexique ont augment de sac adidas pas cher 21 pour cent.Et quand vous voyez une dame Coussin avec des mots comme une princesse ou trne, ou d'autres expressions, comme la Reine du chateau Sac Longchamp 2012, il est, ess.Habituellement dsign d'tre un Sacs Longchamp d'embrayageou peut-tre un sac main d'embrayage ce produit fait exactement ce que le style de la marque implique.

---
dggfg
 Posted 7 years ago
Comment Quote

Post ID #14861 (Level 2) and Parent is 3094
Reply Posted 6/4/2012 2:50:57 AM

Revive Thread!

Add a comment to revive this old thread and make this archived thread more useful.

Write a Comment...
Full Editor
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P1142A1
Enter key:
Icon: A Post    Thread    Idea    Important!    Cool    Sad    No    Yes    Includes a Link...   
Thread #3094 Counter
37838
Since 4/2/2008

Follow PrestwoodBoards on: 


©1995-2019 PrestwoodBoards  [Security & Privacy]
Professional IT Services: Coding | Websites | Computer Tech