Simple http post example in Objective-C?
问题 I have a php webpage that requires a login (userid & password). I have the user enter the information into the app just fine.. but I need an example on how to do a POST request to a website. The apple example on the support site is rather complicated showing a picture upload.. mine should be simpler.. I just want to post 2 lines of text.. Anyone have any good examples? Alex 回答1: This is what I recently used, and it worked fine for me: NSString *post = @"key1=val1&key2=val2"; NSData *postData