HTTP Post with URL parameters like GET?

Posted on 2008-11-18
Last Modified: 2013-11-19
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:

DATA: param4=yes&param5=no....

Question by:mikecrowe
    LVL 70

    Expert Comment

    by:Jason C. Levine
    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...

    Author Comment

    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?
    LVL 70

    Accepted Solution

    >> 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" />

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


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

    Author Closing Comment

    Perfect, jason1178.  Many thanks.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
    Read about why website design really matters in today's demanding market.
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now