OKSosume Posted October 14 Share Posted October 14 I have an API created in PHP. I have been struggling with sending JSON as a POST. I have POSTMAN working with the API and JSON but, I cannot seem to get it to work from C#. In the PHP server code, I have been using URL parameters with "functionname='GetProducts'?data="merchantId=100" but I'd like to POST with JSON content instead of the URL values. Any help would be appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/324924-how-to-post-json-to-a-php-server-from-c/ Share on other sites More sharing options...
OKSosume Posted October 14 Author Share Posted October 14 Quote Link to comment https://forums.phpfreaks.com/topic/324924-how-to-post-json-to-a-php-server-from-c/#findComment-1637775 Share on other sites More sharing options...
Barand Posted October 14 Share Posted October 14 How is your data expected to look when received by the API? You've shown two separate sets of data so far - is that just to confuse us? Quote Link to comment https://forums.phpfreaks.com/topic/324924-how-to-post-json-to-a-php-server-from-c/#findComment-1637778 Share on other sites More sharing options...
Solution OKSosume Posted October 15 Author Solution Share Posted October 15 Why would I want to confuse anyone? I was asking for suggestions. And two sets of data? Are you referring to the JSON I posted in the image? That would be an array of 2 objects. And, I do appreciate your looking to help but, the issue turned out to be the fact that I was running MAUI code and Androids do not post to http - only https. I switched to Windows and it worked as expected. Thank you, though. Quote Link to comment https://forums.phpfreaks.com/topic/324924-how-to-post-json-to-a-php-server-from-c/#findComment-1637808 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.