I have this code in Python that was quite simple to do with mechanize to just go into a URL and click the submit button:
from mechanize import ParseResponse, urlopen, urljoin
response = urlopen("http://www.somesite.com/somepage")
forms = ParseResponse(response, backwards_compat=False)
form = forms[0]
print urlopen(form.click()).read()
Now the question is: Is there any library/simple method to do this in Objective-C?
I’ve seen some more or less of similar examples with NSURL that where quite big, but since I’ll be doing this to a bunch of diferent sites, it doesn’t look like a simple thing to go torugh some dozens of code lines to each one of them and debug everything if there is some easy way like with mechanize.
Regards,
Bruno
Check this site: http://allseeing-i.com/ASIHTTPRequest/
It is not actually what you want, but you can send the POST/GET values to the form action page.
if you have a page http://test.com/form.php with following form:
you can use this code, to perform this form.