Tech Tip: Convert POST forms into GET to link directly to search results.

Say you want to link to all clinical trials on a certain disease or using a certain treatment method. ClinicalTrials.gov has an advanced search, where you can enter your criteria. However, because the form uses the POST method to send the search query, the page URL doesn’t change and you have no way of bookmarking the resulting page. Not all search forms work like this. Google, for example, has the query in the URL, like so: http://www.google.com/search?q=post+get+url+bookmark so you can just copy and paste the URL from whatever page you’re on. It turns out that even if the form uses POST, you can often submit a GET request and get the same results. There’s even a bookmarklet that will convert the POST form to GET for you. Just click the bookmarklet on the search form page, then hit the button as usual. This time the parameters that were sent will be shown in the URL, and you can copy that URL, link to it, and it will fetch the results directly. Here’s a link to all the clinical trials being conducted on Multiple Myeloma

Tags: , , , , , , , ,

3 Responses to “Tech Tip: Convert POST forms into GET to link directly to search results.”

  1. [...] When you enter search terms into a form on a page, as for a database search, and the URL for the results page doesn’t show the parameters in the result page URL, you might think there’s no way to cite those results, however, there’s usually a way to put the search parameters in the URL, so that you can link directly to a page of search results or other dynamically generated content. Remember, a permalink is just a special kind of database query, so this shouldn’t sound too strange. Here’s an example of a link to all the clinical trials being conducted on Multiple Myeloma. This post tells you how to make database query parameters show up in the URL. [...]

  2. Here is an online conversion tool that will convert all the GET parameters from a URL into a POST request: http://www.gettopost.com. It enables URLs requiring POST parameters to be cited or bookmarked e.g. http://www.gettopost.com/gettopost.html?http://www.urltoconvert.com?postparameter1=value1&postparameter2=value2

    There is also a bookmarklet on http://www.gettopost.com/gettopost.html that can be used to extract URLs for all the forms on a webpage (converting any that use a POST request as described).

    HTH,
    Steve

  3. Mr. Gunn says:

    Thanks, Steve.

Leave a Reply