How C # generates a JSON string to submit to an interface (server)

Source: Internet
Author: User

Chapter One: How does C # get the JSON data back from HTTP? Chapter Two: How does C # parse JSON data? (Deserialization object) Chapter III: How does C # generate a JSON string? (serialized Object) Chapter Fourth: How C # generates a JSON string to submit to an interface (server)?

In the previous article we wrote the C # generated JSON string, then what do we generate the string to do? Of course, the data is submitted to the server. The interface is generally used to accept this JSON.

Here we will use one of the classes in the first chapter. Httpuitls the Post method inside.

Very simple:

public static string Post (String Url, String Data, string Referer);

Parameter description: URL-submitted interface address

Data: Is the JSON string to commit

Referer: File header, give an empty string to it.

OK, come here, the daily use of C # operation JSON is over, is not very simple!

How C # generates a JSON string to submit to an interface (server)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.