Forum OpenACS Development: How to use util::httppost

Collapse
Posted by asif noor on
hi ,

Can anyone tell me how to use util::httppost? I had searched in google and IRC chats, but i did not find anything related to it.

Can i use httppost to send to https://?

i mean to a secure site.

i am using
util_httppost "https://www.mydomain.com/purchase?formvars {$instId}"

no value given for parameter "formvars" to "util_httppost"

thanks.

Collapse
Posted by Torben Brosten on
I believe you're looking for the added tcl api that comes with nsopenssl:

http://www.scottg.net/webtools/aolserver/modules/nsopenssl/tclapi/

hope this helps,

Torben

Collapse
Posted by asif noor on
hmm, i had seen that ns_httpspost.

But the problem is, now i can post to that site, but unable to redirect it to that site.

I want even to get redirected to that site with the data in encrypted format.

Collapse
Posted by Torben Brosten on
Could you be more specific?

Describing a hypothetical example of what you are trying to do would help identify the problem area.

Collapse
Posted by asif noor on
hey,

I am having one ad_form. in whch the user enter the details. In the on_submit block i will generate one id, which needs to be send to an https://somesite.com along with the details of form.

now how can i send the data to the site wihout specifying it in the url, i.e i want to send the data in a post format.

ns_httppost is posting the data to that site, but i am unable to redirect to that site. I want even the user to be redirected to that site with the data in an encrypted manner.

I cant keep the id as hidden, as it is insecure, thats why i am generating in on_submit block.

Collapse
Posted by Torben Brosten on
Can the id be generated before the form is submitted, for example when the form is created?

If you can have the id generated and included with the form hidden input (via https to the browser), then I think posting directly to the other site will work.  For a manually created form, I think you can do what you want by changing the form tag's action attribute to "https://somesite.com/actionpageurl".  I'm not sure how to specify that in ad_form as I haven't learned it yet.

Otherwise, I think you'll have to use a cookie to convey the data.

Hmm.. Well, that would be via http and insecure, not what you want.

Looks like the requests would go like this:

browser requests form via https from site1

site1 generates id and returns form via https with id

broswer posts via https to site2