Kinook Software Forums

Go Back   Kinook Software Forums > Visual Build Professional > [VBP] General Discussion

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 07-06-2010, 11:05 AM
TracyP TracyP is online now
Registered User
 
Join Date: 12-18-2006
Posts: 14
HTTP Post in 7.5b

I have setup an HTTP action
Put: Post form data
Get: Get to macro
URL: myurl.php
Macro: PostResponse
Do not escape special characters: not checked
Transfer type: ASCII
Form Data: action=3&program_date=07/06/2010
Logging: All + Hex dump

--

The php script I'm posting to is not getting the Form Data.
The Hex dump is not showing the Form Data.

Any suggestions?

[correction]
I didn't look high enough, the data did get sent. The PHP script isn't seeing the data though.

Last edited by TracyP; 07-06-2010 at 11:15 AM.
Reply With Quote
  #2  
Old 07-06-2010, 12:03 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 5,758
I'm not sure. Testing the attached sample w/ 7.5b on Windows XP SP3 produces the expected output of

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en-US">
<head>
<title>Echoing submitted form data</title>
</head>
<body>
<h1 style="font-size:1.2em">Echoing submitted form data</h1>
<table border="1" cellspacing="0">
<tr><th align="left" nowrap><tt>Comments</tt></th><td nowrap><tt>xyz</tt></td></tr>
<tr><th align="left" nowrap><tt>box</tt></th><td nowrap><tt>yes</tt></td></tr>
</table>
<p>Processed 2010-07-06T16:01Z
</p>
</body>
</html>

http://www.kinook.com/Forum/showthre...?threadid=3044
Attached Files
File Type: bld http.bld (685 Bytes, 443 views)
Reply With Quote
  #3  
Old 07-06-2010, 06:48 PM
TracyP TracyP is online now
Registered User
 
Join Date: 12-18-2006
Posts: 14
I downloaded Fiddler to discover the problem. It appears when posting data the Content-Type header needs to be set to 'application/x-www-form-urlencoded'.

This worked in the 6.x version I was using prior to upgrading the system and software.


Watching what is posted via VBP
Code:
POST http://powerchurchsoftware.com/test/index.php HTTP/1.1
Host: powerchurchsoftware.com
Content-Length: 19

action=3&version=A0
returns
Code:
HTTP/1.1 200 OK
Date: Tue, 06 Jul 2010 22:34:18 GMT
Server: Apache
X-Powered-By: PHP/5.2.13
Vary: Accept-Encoding
Content-Length: 13
Content-Type: text/html

array(0) {
}
Changing the post to this:
Code:
POST http://powerchurchsoftware.com/test/index.php HTTP/1.1
Host: powerchurchsoftware.com
Content-Length: 19
Content-Type: application/x-www-form-urlencoded

action=3&version=A0
Properly returns the array
Code:
HTTP/1.1 200 OK
Date: Tue, 06 Jul 2010 22:45:51 GMT
Server: Apache
X-Powered-By: PHP/5.2.13
Vary: Accept-Encoding
Content-Length: 77
Content-Type: text/html

array(2) {
  ["action"]=>
  string(1) "3"
  ["version"]=>
  string(2) "A0"
}
Reply With Quote
  #4  
Old 07-06-2010, 07:40 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 5,758
Add a value that requires encoding (spaces or special characters, i.e., action=3&version=A0
&x=a b). The version of the third-party networking component used in v7 only adds the Content-Type header if there are values that require encoding.
Reply With Quote
  #5  
Old 07-07-2010, 09:32 AM
TracyP TracyP is online now
Registered User
 
Join Date: 12-18-2006
Posts: 14
OK, added an extra variable and the array is filled in.

Thank you.
Reply With Quote
  #6  
Old 07-07-2010, 09:49 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 5,758
Also, in v7.6, you can explicitly set header values (Options tab).
Reply With Quote
  #7  
Old 07-07-2010, 10:23 AM
TracyP TracyP is online now
Registered User
 
Join Date: 12-18-2006
Posts: 14
I like that idea better.
Thanks for the new release.
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 04:29 PM.


Copyright 1999-2019 Kinook Software, Inc.