Swift到PHP; 从iOS发送Post请求到PHP服务器[重复]

This question is an exact duplicate of:

I am a web developer, and recently have started to learn Swift. I have been successful in communicating with PHP server, while using GET requests. However, I have yet to manage sending POST requests to the server. For example, traditionally when I submit the following HTML form to the server, I can easily get me variables as part of $_POST array on the server:

<form method="POST" action="www.something.com/submit_form.php">
 <input type="text" name="varName" value="someValue">
 <input type="submit" name="submitButton" value="Submit">
</form>

I am wondering if you can help me to find a way for sending a similar POST Request from Swift to "www.something.com/submit_form.php"

Your help is very much appriciated.

</div>

You'll need to build a POST request using NSMutableURLRequest. You can set the HTTP Method to POST and build out the parameters you would like to send.

See "Making a POST Request in Swift"