-
Notifications
You must be signed in to change notification settings - Fork 11
Deserialization
Mahmoud A. Zaid edited this page Mar 17, 2019
·
4 revisions
In this lesson, we will Understand the concept of Deserialization with RestSharp in C#
Serialization is a process of converting an object into a sequence of bytes which can be persisted to a disk or database or can be sent through streams. The reverse process of creating an object from a sequence of bytes is called deserialization.
- Serialization is a process of converting an object into a sequence of bytes such as Json which can be persisted to a disk or database or can be sent through streams. The reverse process of creating object from sequence of bytes is called deserialization.
- Deserialization Converting any encoding format to Objects
RestSharp includes deserializers to process XML and JSON. Upon receiving a response, RestClient chooses the correct deserializer to use based on the Content-Type returned by the server.
- application/json - JsonDeserializer
- application/xml - XmlDeserializer
- text/json - JsonDeserializer
- text/xml - XmlDeserializer
- *+json - JsonDeserializer (content types using a Structured Suffix Syntax specifying JSON)
- *+xml - XmlDeserializer (content types using a Structured Suffix Syntax specifying XML)
- @*@ - XmlDeserializer (all other content types not specified)
- Serialize it to create the request body and send it as a JSON file
- Deserialize it into an object type that makes sense for the consumer, accesses the response content and check if the returned response is correct
Mahmoud A. Zaid
- Introduction
- HTTP Methods
- HTTP Request
- API Parameters
- HTTP Response
- HTTP Status Code
- Methods Examples
- Idempotence