Kinook Software Forum

Kinook Software Forum (https://www.kinook.com/Forum/index.php)
-   [VBP] General Discussion (https://www.kinook.com/Forum/forumdisplay.php?f=2)
-   -   HTTP Post in 7.5b (https://www.kinook.com/Forum/showthread.php?t=4569)

TracyP 07-06-2010 10:05 AM

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.

kinook 07-06-2010 11:03 AM

1 Attachment(s)
I'm not sure. Testing the attached sample w/ 7.5b on Windows XP SP3 produces the expected output of




Echoing submitted form data


Echoing submitted form data





Commentsxyz
boxyes

Processed 2010-07-06T16:01Z





http://www.kinook.com/Forum/showthre...?threadid=3044

TracyP 07-06-2010 05:48 PM

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"
}


kinook 07-06-2010 06:40 PM

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.

TracyP 07-07-2010 08:32 AM

OK, added an extra variable and the array is filled in.

Thank you.

kinook 07-07-2010 08:49 AM

Also, in v7.6, you can explicitly set header values (Options tab).

TracyP 07-07-2010 09:23 AM

I like that idea better.
Thanks for the new release.


All times are GMT -5. The time now is 09:33 PM.


Copyright © 1999-2023 Kinook Software, Inc.