NSURLConnection connecting to server, but not posting data

前端 未结 2 1933
情歌与酒
情歌与酒 2021-01-24 05:30

Whenever I attempt to post something to my PHP Server, I receive the following message. It seems as if the code is connecting to the server, but no data is returned, and the pos

2条回答
  •  孤城傲影
    2021-01-24 06:04

    "name=%@&email=%@&phash=%@" is not a proper url-encoded string. Each key-value pair has to be separated by an '&' character, and each key from its value by an '=' character. Keys and values are both escaped by replacing spaces with the '+' character and then encoded by stringByAddingPercentEscapesUsingEncoding.

    See application/x-www-form-urlencoded.

    You can find a recipe how to do this in this blog post.

提交回复
热议问题