Page 2 of 2

Re: CXP / HTTP Samples

Posted: Fri Apr 17, 2015 3:57 am
by Zdeno Bielik
I don't understand. What is CHS?
ooops, sorry

CHS => CxpHttpServer ;)

Re: CXP / HTTP Samples

Posted: Sat Apr 18, 2015 2:55 am
by Zdeno Bielik
Roger,

ok, CxpHttpServer now shows my test-form, but it is any problem with its validating, when I press on Submit button.
aVars is still empty.
I don’t know, if it is any my mistake in format of calling code (I did try more httpRequest/getForm() combinations without success)
or if Submit method doesn’t work yet.

Please, can you look at it, because I can’t continue work without this.

TIA & Regards
Zdeno

p.s. one more question: how is it possible show how many users are currently browsing/using CxpHttpServer or eventualy also concrete sub-page?

Re: CXP / HTTP Samples

Posted: Sat Apr 18, 2015 6:47 am
by rdonnay
Zdeno -

I will look at your code this morning.
Sorry, but I have been very busy lately.

Re: CXP / HTTP Samples

Posted: Sun Apr 19, 2015 2:16 am
by Zdeno Bielik
Roger,

ok, I understand, I will wait.

here is some next info, may be it will helps you solve this problem:

when I changed POST method to GET method, it started work,
but now all sended data are included in url address and
are visible for all...

is: cHtml += '<form action="/MyTest02/Form01?submit" method="POST">' + CRLF
was: cHtml += '<form action="/MyTest02/Form01?submit" method="GET">' + CRLF


some debug infos after Submiting form when page is loaded again:

wtf ::httpRequest:getQueryString()
* when POST – just text submit
* when GET - ok: e.g.: login=zdeno&password=123456 etc...

wtf ::httpRequest:form
* HttpNameValueContainer -> empty list

wtf ::httpRequest:getForm()
* HttpNameValueContainer -> empty list

wtf ::MyTest02:GetVar( 'login' )
* when GET - ok: e.g.: zdeno



also, in ::classDescribe()[3] are only two items


Zdeno

Re: CXP / HTTP Samples

Posted: Mon Apr 20, 2015 6:49 am
by rdonnay
I knew about the POST vs GET problem.

This is only a problem with WebHandler, not with IIS or Apache.
Steffen confirmed this and said it will be fixed.

::httpRequest:getQueryString() would return an empty string on a POST because that data is never part of the query string.

This is the difference between a POST and a GET.
GET always returns the data in the same way that it would be attached to the URL string.

Of course, this would also cause ::httpRequest:form:httpNameValueContainer to be empty because this is where POST information would go.

The HttpRequest() class is not very well documented yet.
Steffen has assured me that they are working on this.

Re: CXP / HTTP Samples

Posted: Mon Apr 20, 2015 9:43 am
by Zdeno Bielik
Roger,

ok, many thanks for this info.
I hope, fix and documentation too will be available soon...

Zdeno