Jump to content

How to post JSON to a PHP server from C#


Go to solution Solved by OKSosume,

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/324924-how-to-post-json-to-a-php-server-from-c/
Share on other sites

  • Solution

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.