jakebur01 Posted November 10, 2019 Share Posted November 10, 2019 I have some data I'm posting from Swift to my php file via x-www-form-urlencoded. How can I decode this POST data? Quote Link to comment Share on other sites More sharing options...
requinix Posted November 10, 2019 Share Posted November 10, 2019 You don't. The data will be in $_POST. You know, like it normally is. Quote Link to comment Share on other sites More sharing options...
jakebur01 Posted November 10, 2019 Author Share Posted November 10, 2019 This did it: https://www.google.com/amp/s/www.geeksforgeeks.org/how-to-receive-json-post-with-php/amp/ Quote Link to comment Share on other sites More sharing options...
requinix Posted November 11, 2019 Share Posted November 11, 2019 That's JSON. Do you not know what you're doing? Quote Link to comment Share on other sites More sharing options...
jakebur01 Posted November 11, 2019 Author Share Posted November 11, 2019 No, I don't. But I'm learning. It has the x-www-form-urlencoded header. It then is json encoded and has the json header. So, I guess it used both. Quote Link to comment Share on other sites More sharing options...
requinix Posted November 11, 2019 Share Posted November 11, 2019 It can't be both... It could be that some data was JSON-encoded, then put into a urlencoded request, like key=value&json=%7B%22a%22%3A%22b%22%7D but that would be silly. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.