473,226 Members | 1,433 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,226 software developers and data experts.

How to modify the Request-Line ?

Is it possible to modify the Request-Line of an HTTP response ?
I'd like to remove the parameters from a GET url.

More precisely, I wish I could replace :
[From Req: GET /myuri?key1=val1 HTTP/1.1]
with :
[From Req: GET /myuri HTTP/1.1]
The "Header" function doesn't seem to allow this.

Thanks.

Jul 17 '05 #1
5 2049
patrice wrote:
Is it possible to modify the Request-Line of an HTTP response ?
I'd like to remove the parameters from a GET url.


If I'm not mistaken, the Request-Line is in the incoming HTTP request,
not the response.

What would be the point in altering it once it's arrived? If you don't
want to use the GET parameters, then don't!

Or am I misunderstanding you?

--
Oli

Jul 17 '05 #2
patrice wrote:
Is it possible to modify the Request-Line of an HTTP response ?
I'd like to remove the parameters from a GET url.

More precisely, I wish I could replace :
[From Req: GET /myuri?key1=val1 HTTP/1.1]
with :
[From Req: GET /myuri HTTP/1.1]
The "Header" function doesn't seem to allow this.


This is usually done through a Location: header, which is received by the
browser and translated into a new GET request with the URL defined by this
header. Example:

<?php

if ($_REQUEST['QUERY_STRING']) {
header("Location: http://mysite.com/myuri/");
exit;
}

?>
JW

Jul 17 '05 #3
My aim is as follow : I want to use a form and a javascript
location.replace() together, in order to replace the curent page in the
browser's history list.
So I'm forced to use the GET method (there doesn't seem to be a way to
achieve this through location.replace when using the POST method).
But when using GET, the parameters will appear at the end of the URL
displayed in the client's browser, which I don't want. This URL is the
one returned by the server's response and could be different from the
one appearing in the request (I need to check this however). So if I
could remove the parameters from the Request-Line sent to the client,
it would be OK : the client wouldn't see the parameters in the url but
I still could use the GET parameters through $_GET for instance.
I cannot use a :
header("Location: http://mysite.com/myuri/");
exit;

because it works differently ; it first sends the new location to the
client which then requests the new page. It costs a second
request-response exchange. Further more, in [From Req: GET
/myuri?key1=val1 HTTP/1.1], the key1=val1 is a true parameter, not an
url. I'm not interested in doing on the fly url translation.
Removing the parameters from the url with Apache's rewriting module
wont do it neither, because PHP would in this case never receive the
parameters.
So modifying the request-line with PHP - if possible - is the only
solution I've found till now.

Patrice

Jul 17 '05 #4
patrice said the following on 05/06/2005 08:43:
My aim is as follow : I want to use a form and a javascript
location.replace() together, in order to replace the curent page in the
browser's history list.
Why? Sites that try to take control of the user's browser are usually
just a pain in the arse.

Plus if the user has JS disabled, your page won't work at all...
So I'm forced to use the GET method (there doesn't seem to be a way to
achieve this through location.replace when using the POST method).
But when using GET, the parameters will appear at the end of the URL
displayed in the client's browser, which I don't want. This URL is the
one returned by the server's response and could be different from the
one appearing in the request (I need to check this however). So if I
could remove the parameters from the Request-Line sent to the client,


As I've already said, the Request-Line is *not* part of the server's
HTTP response, but part of the client's (browser's) HTTP request.

The only time the server sends back a URL (that appears in the browser)
in an HTTP response is in a Location header.

--------------------

Off the top of my head, the only way that I could see to do this (and
it's messy), is:

* Do the location.replace(), with the form variables in the GET string.

* Then have the server collect up all the submitted $_GET variables and
dump then in $_SESSION.

* Do a header("Location: http://example.com/simple_url/") redirect.

* At the new location, pick up the variables from the $_SESSION variable.

This is untested.
--
Oli
Jul 17 '05 #5
Oli Filth wrote :
As I've already said, the Request-Line is *not* part of the server's
HTTP response, but part of the client's (browser's) HTTP request.


I was mislead by the results of HTTP Interceptor (which adds the
Request-Line in the response to track messages more easily).

Sorry for all this.

Thanks.

Jul 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Glenn | last post by:
Searching through google groups, I have not found anyone able to modify the query string of a request. I was hoping to make the query string as short as possible so that a search with many...
16
by: Philippe C. Martin | last post by:
Hi, I am trying to change the data in a form field from python. The following code does not crash but has no effect as if "form" is just a copy of the original html form. Must I recreate the...
0
by: Kevin | last post by:
I am successfully creating and deleting appointments and sending invitations in a C# / ASP.NET / Exchange2000 environment. It works great! But the problem is that no notifications are sent out...
3
by: Marc Gingras | last post by:
Hi, I tried to modify the request object when my aspx page is loaded(or before). When I try to do it a received a "Read only" error message. Is it possible to modify a Request when the server...
1
by: Henry | last post by:
Hi. I've been trying to modify my dataset and have been unsucessful. Any help would be great. What I have is a dataset in a session variable. Here is what I have done to stored into the dataset...
6
by: Dave Slinn | last post by:
I have a VB app hosting the Webbrowser control. I would like to add "something" to the requests that app is submitted to our web application to indicate that its from this webbrowser and not a...
1
by: ABCL | last post by:
Hi all I am develoing Asp.net application, but want to make it secure.. Is there anyway that I can Modify/Remove Request Header which contains some User related data? Thanks In Advanace Thanks...
20
idsanjeev
by: idsanjeev | last post by:
hello i want to modify multiple rows in database with select option i am using R.update but it can update only one record in database but i wants to more then one record is modify after submit so...
0
by: Sanjib Biswas | last post by:
Hi, I have an ASP.Net application which talks to an ASP application. As the ASP.Net application talk to the ASP application, the REMOTE_ADDR server variable points to the IP address of the...
3
mickey0
by: mickey0 | last post by:
hello, I read this server class, and I'm wondering how modify it in a way that the server can serve more than one request. link Could anyone get me a hint, please?
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.