How to create an HTTP GET request with a form - http

How do I send an HTTP GET request without a form? This request is performed on a web page.
For more details on what I'm trying to accomplish and why, see my question here: http get/post request and google geolocation api

Any link is a GET request, so, just make a link, add the extra info at the end, done.
http://someurl.net/somelink?value1=avalue&value2=anothervalue

A normal hyperlink does a GET request when the user clicks on it. Loading an image is also a GET request, as are most of the other ways of embedding things in a page. If you're trying to do it via JavaScript, you can use an XMLHttpRequest.

You can use Ajax and jQuery's get method:
$.get("someURL.php?variables=true");
Note, that you will only be able to make requests to the same domain OR the target domain must return JSON formatted results.

In plain HTML you can do that e.g. requesting an image:
<img src="http://example.com/?bla=bla">

< a href="www.google.com">google</a>

I agree with altCognito points out using jquery but I'd rather use
$.get("someurl.php", { variable: value });
I like this way better because it allows me to send objects instead of concatenate strings.
you can see a couple of samples here

Related

web scraping from https://ngodarpan.gov.in/index.php/home/statewise_ngo/61/35

Is it possible for me to scrape the data from the pop up appears after clicking the link.the website is https://ngodarpan.gov.in/index.php/home/statewise_ngo/61/35
Of course it's possible, it's just a table with pagination.
But you'd better check the legal part before scraping a website, moreover on a governmental one.
Yes, you have to follow exactly what browser does. See network behaviour from your browser.
First, you have to send request to https://ngodarpan.gov.in/index.php/ajaxcontroller/get_csrf in order to get token like this :{"csrf_token":"0d1c59184c7df788dc4b8759f6da40c6"}
After, send another POST request to https://ngodarpan.gov.in/index.php/ajaxcontroller/show_ngo_info. As parameters you have to mention csrf_test_name which which is equals to csrf_token and id which is found from onclick attribute of each link.
You will get JSON as response and just to parse it as you need.

JXBrowser, intercepting loading of a script, and change it's contents.

I know you can add a LoadAdapter, and implement onStartLoadingFrame
but is it possible to modify the response? IE the content sent to the client. I cant seem to see the responseText anywhere yet to modify it.
You can use CustomProtocolHandler to response with custom data.
Please take a loot at the article for details.

Tamper GET request parameter with Tamper Data in Firefox?

I am able to tamper post request parameter with Tamper Data in firefox i.e when i make
post request and i get the popup in firefox to change POST request parameters but in case
of GET request, i get the popup but there is no way to change the request parameter.
So question is Can't we change the request parameter thru Tamper Data/Fiddler?(Yes i agree
we can change it from browser address bar but that will be applicable once first request has been firect but i want to tamper some data in the very first Get Request. So i want to change GET request paramater with Tamer Data/Fiddler.Is it possible?)
You can't do that using Tamper-Data. You could use a more advanced standalone-tool, like Web Scarab which will let you intercept and edit all portions of your web-requests.
Using fiddler, in conjunction with FiddlerScript is also an alternative.
You can easily use Fiddler to tamper with any aspect of a request or response. You can do this using FiddlerScript or manually using breakpoints. To change traffic manually using breakpoints, watch this tutorial video: http://www.youtube.com/watch?v=8bo5kXMAcV0&list=PLvmaC-XMqeBbw72l2G7FG7CntDTErjbHc
You can also use: Live http header addon. Hope it help.

How know the current url before requesting general handler using ajax ?

I think the title isn't clear enough because I didn't know how to ask it.
What I'm doing is requesting general handler using ajax and I want to know the current url of the page, I think I can use javascript method to get the current url and send it with the request as parameter, but the problem is that the user can change the url before clicking the button and sending the request so I'll never knew if this is the real url.
Any idea how can I do it ?
Many thanks
I think that the safest way is to get it from the server-side. You can use this.Request.UrlReferrer to get this information.
I think window.location.href is always the real url.

Using Selenium : How to modify or inject into HTTP Post Data Request Header?

Please note this question is related to Selenium.
Before a HTML form submit i.e., selenium.click("//button[#type='submit']");
I want to inject a name value pair at native level in the HTTP Post back to the Server e.g.
Change HTTP Post from:
POSTDATA=register=true&accountType=customer
To:
POSTDATA=register=true&accountType=customer&mynewfield=true
Working with Selenium commands its not obvious how to intercept and modify what is posted back to the server.
Any ideas of how to achieve desired result in Selenium or something that can be called from Selenium? Kindly appreciated NJ
In theory you could use javascript or jQuery to alter the page. For example, using jQuery you could add a hidden form element with a default value or pre-set value that will then be passed upon form submission. (if i understand your question right - emulating TamperData?)

Resources