GET Message format HTTP

D

Dodger

Apologies if the is the wrong NG.

But I have trapped a GET issued by a webpage on a button press and I would
like to issue the GET programatically as-and-when I wish.

I wondered what the text before the get text signifies? I imagine they are
variable names and parameter values.

Is this correct?

Would someone tell me how I can go about decoding them (or give a
reference(s)), so I can find out what I should actually send in the GET?

Here is a sample of format of the instruction I have trapped.

Thanks

AlphaIDs=&origin=placeAlpha&SelectionIDs=20930%7C&BidTypes=B%7C&Part=10%7C&N
ewPart=&Effort=2%7C&NewEffort=&Modes=&SubEventIds=&MktType=O&ei=2339117&iid=
Standard&fa=pb&iCard=&placeAlpha_guessLayMakeOwe=OweGET
/fishing/LoadMDA.do?mi=2339117 HTTP/1.0
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/vnd.ms-excel, application/msword, application/vnd.ms-powerpoint,
*/*
Accept-Language: en-us
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0
Host: WWW.DUMMY_SITE.COM
 
M

McKirahan

Dodger said:
Apologies if the is the wrong NG.

But I have trapped a GET issued by a webpage on a button press and I would
like to issue the GET programatically as-and-when I wish.

I wondered what the text before the get text signifies? I imagine they are
variable names and parameter values.

Is this correct?

Would someone tell me how I can go about decoding them (or give a
reference(s)), so I can find out what I should actually send in the GET?

Here is a sample of format of the instruction I have trapped.

Thanks

AlphaIDs=&origin=placeAlpha&SelectionIDs=20930%7C&BidTypes=B%7C&Part=10%7C&N
ewPart=&Effort=2%7C&NewEffort=&Modes=&SubEventIds=&MktType=O&ei=2339117&iid=
Standard&fa=pb&iCard=&placeAlpha_guessLayMakeOwe=OweGET
/fishing/LoadMDA.do?mi=2339117 HTTP/1.0
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/vnd.ms-excel, application/msword, application/vnd.ms-powerpoint,
*/*
Accept-Language: en-us
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0
Host: WWW.DUMMY_SITE.COM

How did you trap the above?

It looks like that the relevant part is
/fishing/LoadMDA.do?mi=2339117

Thus you could do:
location.href = "/fishing/LoadMDA.do?mi=2339117";
whenever you wanted.

I'm not sure what the first several lines are for.
They seem like name/value pairs (some with no value):

AlphaIDs=
&origin=placeAlpha
&SelectionIDs=20930%7C
&BidTypes=B%7C
&Part=10%7C
&NewPart=
&Effort=2%7C
&NewEffort=
&Modes=
&SubEventIds=
&MktType=O
&ei=2339117
&iid=Standard
&fa=pb
&iCard=
&placeAlpha_guessLayMakeOwe=OweGET
 
D

Dodger

McKirahan said:
AlphaIDs=&origin=placeAlpha&SelectionIDs=20930%7C&BidTypes=B%7C&Part=10%7C&N
ewPart=&Effort=2%7C&NewEffort=&Modes=&SubEventIds=&MktType=O&ei=2339117&iid=

Hi,

Thanks for your reply,
How did you trap the above?

Using an MFC prog from codeproject.com using a webbrowser control - not in
javascript which I don't know much about unfortunately;(
It looks like that the relevant part is
/fishing/LoadMDA.do?mi=2339117

Thus you could do:
location.href = "/fishing/LoadMDA.do?mi=2339117";
whenever you wanted.

Yes I have successfully done this on "normal" GET's ie without the "name
value" pairs you describe.
I'm not sure what the first several lines are for.
They seem like name/value pairs (some with no value):

AlphaIDs=
&origin=placeAlpha
&SelectionIDs=20930%7C
&BidTypes=B%7C
&Part=10%7C
&NewPart=
&Effort=2%7C
&NewEffort=
&Modes=
&SubEventIds=
&MktType=O
&ei=2339117
&iid=Standard
&fa=pb
&iCard=
&placeAlpha_guessLayMakeOwe=OweGET

But I know what 20930 (var3) and 10 (var 5) and 2 (var 7) 2339117 (var 12)
are, as I am updating the website (database) with these values.

What I am confused about is what relationship the "name-value" pairs as you
have identified have with the GET. Are they just sent "as-is" literally or
will the web page transform them somehow?

If they are "hard-coded" can I then just prefix them to the GET string?

What does the website server (HTTP protocol) recognise tham as being? Are
they also parameters? They should be as, because I said I am updating the
database with these values. I haven't found a description of what they
signify in any HTTP protocol docs I have found.

I know the "?" after the GET identifies parameters, but I repeat it makes
sense if these pairs are also parameters to the GET.

What does the "%7C" represent which appends many of the variables?
I wonder, could it be unicode for something which my trapping has
transformed? They do append all my input data (I know what var 12 is but I
don't actually input it and it has the '%7C' missing).

I could try trial and error, but it is a "live" database and I don't want to
screw up my account details!!!

Thanks again.
 
M

McKirahan

Dodger said:
AlphaIDs=&origin=placeAlpha&SelectionIDs=20930%7C&BidTypes=B%7C&Part=10%7C&N
ewPart=&Effort=2%7C&NewEffort=&Modes=&SubEventIds=&MktType=O&ei=2339117&iid=

Hi,

Thanks for your reply,


Using an MFC prog from codeproject.com using a webbrowser control - not in
javascript which I don't know much about unfortunately;(


Yes I have successfully done this on "normal" GET's ie without the "name
value" pairs you describe.


But I know what 20930 (var3) and 10 (var 5) and 2 (var 7) 2339117 (var 12)
are, as I am updating the website (database) with these values.

What I am confused about is what relationship the "name-value" pairs as you
have identified have with the GET. Are they just sent "as-is" literally or
will the web page transform them somehow?

A "get" passes parameters via the QueryString; that which is appended to a
URL following "?".

Multiple parameters are separated by "&".

Parameters are usually (but not always) name=value pairs.
If they are "hard-coded" can I then just prefix them to the GET string?

You would append them. Perhaps the following will work:

location.href = "/fishing/LoadMDA.do
?mi=2339117
&AlphaIDs=
&origin=placeAlpha
&SelectionIDs=20930%7C
&BidTypes=B%7C
&Part=10%7C
&NewPart=
&Effort=2%7C
&NewEffort=
&Modes=
&SubEventIds=
&MktType=O
&ei=2339117
&iid=Standard
&fa=pb
&iCard=
&placeAlpha_guessLayMakeOwe=OweGET";

just make it one long string.
What does the website server (HTTP protocol) recognise tham as being? Are
they also parameters? They should be as, because I said I am updating the
database with these values. I haven't found a description of what they
signify in any HTTP protocol docs I have found.

I know the "?" after the GET identifies parameters, but I repeat it makes
sense if these pairs are also parameters to the GET.

What does the "%7C" represent which appends many of the variables?
I wonder, could it be unicode for something which my trapping has
transformed? They do append all my input data (I know what var 12 is but I
don't actually input it and it has the '%7C' missing).

The "%7C" is a hexidecimal represenattion of a character (7 * 16 + 12 = 124
= |)

Type the following in your browser's address bar (IE only?):
javascript:alert(escape("|") + " = " + unescape("%7C"));
then press Enter.
I could try trial and error, but it is a "live" database and I don't want to
screw up my account details!!!

Better to set up a test database, after all you are testing.
 
D

Dodger

McKirahan said:
AlphaIDs=&origin=placeAlpha&SelectionIDs=20930%7C&BidTypes=B%7C&Part=10%7C&N
ewPart=&Effort=2%7C&NewEffort=&Modes=&SubEventIds=&MktType=O&ei=2339117&iid= "name

A "get" passes parameters via the QueryString; that which is appended to a
URL following "?".

Multiple parameters are separated by "&".

Parameters are usually (but not always) name=value pairs.


You would append them. Perhaps the following will work:

location.href = "/fishing/LoadMDA.do
?mi=2339117
&AlphaIDs=
&origin=placeAlpha
&SelectionIDs=20930%7C
&BidTypes=B%7C
&Part=10%7C
&NewPart=
&Effort=2%7C
&NewEffort=
&Modes=
&SubEventIds=
&MktType=O
&ei=2339117
&iid=Standard
&fa=pb
&iCard=
&placeAlpha_guessLayMakeOwe=OweGET";

But the GET I have trapped *prepends* rather than appends them.
This is what is confusing me.
Maybe I will just try and send the same hardcoded string and see what
happens.


just make it one long string.


The "%7C" is a hexidecimal represenattion of a character (7 * 16 + 12 = 124
= |)

Type the following in your browser's address bar (IE only?):
javascript:alert(escape("|") + " = " + unescape("%7C"));
then press Enter.
want

Better to set up a test database, after all you are testing.

The live database has nothing to do with me. What would I be testing?
I don't understand the format of the GET I have trapped - that is the
problem.

Thanks
 
M

Michael Winter

Apologies if the is the wrong NG.

It is, though I couldn't suggest an alternative.

[snip]
AlphaIDs=&origin=placeAlpha&SelectionIDs=20930%7C&BidTypes=B%7C
&Part=10%7C&NewPart=&Effort=2%7C&NewEffort=&Modes=&SubEventIds=
&MktType=O&ei=2339117&iid=Standard&fa=pb&iCard=
&placeAlpha_guessLayMakeOwe=Owe

I don't think this should be there at all. A GET request starts with the
three octets, "GET". There is nothing before that. From RFC 2616 -
Hypertext Transfer Protocol (HTTP/1.1):

HTTP-message = Request | Response

Request = Request-Line
*(( general-header
| request-header
| entity-header ) CRLF)
CRLF
[ message-body ]

Request-Line = Method SP Request-URI SP HTTP-Version CRLF

Method = "OPTIONS"
| "GET"
| "HEAD"
| "POST"
| "PUT"
| "DELETE"
| "TRACE"
| "CONNECT"
| extension-method

So as you can see, a HTTP request begins with "GET", followed by a URI,
followed by the version information, which is this:
GET /fishing/LoadMDA.do?mi=2339117 HTTP/1.0

Are you sure you didn't get the tail-end of something else?

[snip]

By the way, will one of you two trim your quotations when you post in the
other sub-thread. About 90% of it is text from previous posts.

Mike
 
D

Dodger

Michael Winter said:
Apologies if the is the wrong NG.

It is, though I couldn't suggest an alternative.

[snip]
AlphaIDs=&origin=placeAlpha&SelectionIDs=20930%7C&BidTypes=B%7C
&Part=10%7C&NewPart=&Effort=2%7C&NewEffort=&Modes=&SubEventIds=
&MktType=O&ei=2339117&iid=Standard&fa=pb&iCard=
&placeAlpha_guessLayMakeOwe=Owe

I don't think this should be there at all. A GET request starts with the
three octets, "GET". There is nothing before that. From RFC 2616 -
Hypertext Transfer Protocol (HTTP/1.1):

HTTP-message = Request | Response

Request = Request-Line
*(( general-header
| request-header
| entity-header ) CRLF)
CRLF
[ message-body ]

Request-Line = Method SP Request-URI SP HTTP-Version CRLF

Method = "OPTIONS"
| "GET"
| "HEAD"
| "POST"
| "PUT"
| "DELETE"
| "TRACE"
| "CONNECT"
| extension-method

So as you can see, a HTTP request begins with "GET", followed by a URI,
followed by the version information, which is this:
GET /fishing/LoadMDA.do?mi=2339117 HTTP/1.0

Are you sure you didn't get the tail-end of something else?

Well there is something funny going on :)

I think I may have been getting confused with the previous POST command that
was issued.
That would make sense wouldn't it? As I am updating the database this should
be done with a POST instead of a GET shouldn't it?

Does the POST data string append the POST header?

Heres *exactly* what I have in my log file

POST /fishing/ManipulationAction.do HTTP/1.0
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/vnd.ms-excel, application/msword, application/vnd.ms-powerpoint,
*/*
Accept-Language: en-us
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0
Content-Length: 346
Host: WWW.DUMMY_SITE.COM
Content-Type: application/x-www-form-urlencoded

AlphaIDs=&origin=placeAlpha&SelectionIDs=20930%7C&BidTypes=B%7C&Part=10%7C&N
ewPart=&Effort=2%7C&NewEffort=&Modes=&SubEventIds=&MktType=O&ei=2339117&iid=
Standard&fa=pb&iCard=&placeAlpha_guessLayMakeOwe=OweGET
/fishing/LoadMDA.do?mi=2339117 HTTP/1.0
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/vnd.ms-excel, application/msword, application/vnd.ms-powerpoint,
*/*
Accept-Language: en-us
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0
Host: WWW.DUMMY_SITE.COM

As you can see I thought the update was being done with the GET but perhaps
it was the POST with the formatting of the logging not very clear.

Make sense?

If my above assumptions are true, what should my POST string look like?
I understand how to format the GET, it would be as McKirahan suggested:

ie
http://www.dummy_site.com/fishing/LoadMDA.do?mi=2339117

Should it be (one long string)
http://www.dummy_site.com/fishing/M...a=pb&iCard=&placeAlpha_guessLayMakeOwe=OweGET";

leaving the "%7C"s in place.

I apologise if I want spoon feeding but I am scared to do to much trial and
error as the DB is live with my own personal account details and I dont want
to screw it up.

Thanks - and sorry to you and McKirahan for being stupid ;)
 
M

Michael Winter

[snip]
I think I may have been getting confused with the previous POST command
that was issued. That would make sense wouldn't it?

Yes. I would have suggested it, but I wasn't completely sure.
As I am updating the database this should be done with a POST instead of
a GET shouldn't it?

Generally, yes.
Does the POST data string append the POST header?

As I understand it, yes.

[snip]
If my above assumptions are true, what should my POST string look like?

How are you making the request? If it's via HTML, you'll have to place the
data in a form and submit it that way. You may be able to use the XML HTTP
Request object (<URL:>), but it's support is lower than standard HTML
forms.

[snip]
Thanks - and sorry to you and McKirahan for being stupid ;)

There's nothing to apologise for.

Good luck,
Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top