From: Scott Sauyet on
On Jan 26, 2:16 pm, "Evertjan." <exjxw.hannivo...(a)interxnl.net> wrote:
> Scott Sauyet wrote on 26 jan 2010 in comp.lang.javascript:
>> On Jan 26, 5:55ÿam, Erwin Moller
>> Well, this still is an HTTP POST request.  PHP interprets the query
>> string of the URL as GET variables, but it is not a GET request.
>
> So we should define a GET request in the OQ sense just as a any request
> that is not a HTTP POST request [disregarding the HEAD request which has no
> clientside coding ability]?

No, but there is a specific verb given in the HTTP specification that
is used for each request. If that request responds with a page, there
is no client-side way from that page to know what verb was used; of
course additional server-side help can easily be supplied. That's
what I said in my original response.

> You could do that, but what would be the use for the OP?

I don't know what the OP needs, but if it's to know, for instance,
that the current page is in response to a POST request, I believe that
this is not possible in general without server-side help.

-- Scott
From: Eric Bednarz on
"Evertjan." <exjxw.hannivoort(a)interxnl.net> writes:

> Eric Bednarz wrote on 26 jan 2010 in comp.lang.javascript:

>> I read that
>
> my sentence?

The OP's question:

| Is there a way to know if the current page is a result of a get or
| post?

>> as wanting to know the request method, and I would think
>> that a HTTP server cannot resolve a resource and send response headers
>> without knowing that.
>
> What HTTP-server

I don't know which HTTP server the OP uses. :-)

> What Resource?

The resource that tentatively wants to know if it is a result of a GET
or POST request.

> Why should a server without serverside programming ability [if that is what
> you mean by HTTP-server],

By HTTP server I mean a server that services HTTP requests.

> do anything with the POST content of the request
> header?

¿Que?

>> and send response headers without knowing that.
>
> The request querystring has no special request or response headers.

I think that this might be a pretty silly discussion.

> The POST content is in the request header,

I thought that POST data is send in the message body of the request.

> not in the response header.

I should better just have written 'a response'.

The request method is stated in the request header, and is hopefully
accessible by server-side script (e.g. by the already mentioned
REQUEST_METHOD environment variable). Both response header and message
body may or may not depend on it.
From: The Natural Philosopher on
Evertjan. wrote:
> Thomas 'PointedEars' Lahn wrote on 25 jan 2010 in comp.lang.javascript:
>> Scott Sauyet wrote:
>>
>>> Thomas 'PointedEars' Lahn wrote:
>>>>> Is there a way to know if the current page is a result of a get or
>>>>> post?
>>>> Yes.
>> ^^^^
>>> No.
>>>
>>> At least, assuming you're discussing doing this from Javascript in a
>>> web browser. For any POST you perform, the server could send a
>>> redirect to a GET.
>>>
>>> If you have control on the server-side, you could echo the request
>>> type into a JS variable; in PHP it might be
>>>
>>> var httpMethod = "<?php echo $_SERVER['REQUEST_METHOD']; ?>"
>> See, there is a way :)
>
> No there is not.
>
> The new page can never know

anythinmg. new pages are not intelligent, nor even computing engyns

Straw man. The ELF shot you.
From: The Natural Philosopher on
Scott Sauyet wrote:
> On Jan 25, 4:00 pm, "Evertjan." <exjxw.hannivo...(a)interxnl.net> wrote:
>> The new page can never know if the page request is
>> 1 a result of a bona fide form-get
>> or
>> 2 just from a link contaning an URL with querystring.
>
> I'm not sure that is a meaningful distinction. At the HTTP level,
> both are GET requests, so even the server doesn't distinguish this.
>

It does

> -- Scott
From: The Natural Philosopher on
Eric Bednarz wrote:
> "Evertjan." <exjxw.hannivoort(a)interxnl.net> writes:
>
>> Scott Sauyet wrote on 25 jan 2010 in comp.lang.javascript:
>>
>>> "Evertjan." <exjxw.hannivo...(a)interxnl.net> wrote:
>
>>>> The new page can never know if the page request is
>>>> 1 a result of a bona fide form-get
>>>> or
>>>> 2 just from a link contaning an URL with querystring.
>>> I'm not sure that is a meaningful distinction. At the HTTP level,
>>> both are GET requests, so even the server doesn't distinguish this.
>> No, they could also be POST requests at ther same time.
>
> I would like an example of an HTTP request that simultaneously uses the
> HTTP GET and POST methods.

I do it somewhat regularly..

VERY possible with javascript.
First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4 5 6
Prev: triplet question.
Next: extend prototype chain?