I am looking for a method to select an item from a drop down menu from my website by using RestKit API. I searched the web but it doesn’t give me a relevant result. here is the HTML code for the drop down menu:
<form class="myProfile" method="POST">
<div class="myProfile">Which one is your favorite soccer team?
<select class="team_selection" name="favTeamID" id="favTeamID" onchange="JavaScript:submit()">
<option value="">Select One...</option>
<option value="203">Manchester</option>
<option value="1">Barcelona</option>
<option value="2">Chelsea</option>
</select>
I tried to POST on key values “name” and “id” by using following code:
[RKClient clientWithBaseURLString:@"http://MyWebsite.com"];
NSDictionary* params = [NSDictionary dictionaryWithObjectsAndKeys:
@"Barcelona", @"name",
@"1", @"id",
nil];
RKRequest *request = [[RKClient sharedClient] post:@"/profile.php" params:params delegate:self];
[request setUserData:@"selectFavoriteTeam"];
But it’s not working. I would appreciate if anybody can help me.
I figured it out, I have to POST on favTeamID
here is the code: