HTTP Post with URL parameters like GET?

I realize this is not a normal use-case, but is it legal?  We would like to take a GET request (with a fairly complex URL parameter list), change the method to a POST, and add *additional* data to the body via the POST data.  However, we want to keep the URL parameters constant to maintain compatibility with existing code.

So, summarizing, the POST URL might be something like:

POST: https://www.example.com/dispatch.php?param1=yes¶m2=no¶m3=maybe
DATA: param4=yes&param5=no....

TIA
mikecroweAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jason C. LevineDon't talk to me.Commented:
Hi mikecrowe,

I'm not sure I understand what you want.  Can you explain better and also indicate which language will process the request?

For example, PHP allows variables to exist in both the query string and the post array...
0
mikecroweAuthor Commented:
At this point, we haven't chosen the application language, but are leaning towards .NET.  PHP is also an option.

Basically, I think you understand.  Can there be parameters in the URL and the POST headers?
0
Jason C. LevineDon't talk to me.Commented:
>> Can there be parameters in the URL and the POST headers?

Not sure about .NET (I don't use it) but with PHP, yes.

<form method="post" action="somescript.php?somevar=1&someothervar=2">
<input type="hidden" name="yetanothervar" value="3" />
</form

On somescript.php, the following would be available for handling:

$_GET['somevar']
$_GET['someothervar']
$_POST['yetanothervar']

So long as the query string is present, both the $_GET and $_POST arrays can contain values.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mikecroweAuthor Commented:
Perfect, jason1178.  Many thanks.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development

From novice to tech pro — start learning today.