Media Type Formatters

10 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$49.99
List Price:  $69.99
You save:  $20
€46.41
List Price:  €64.98
You save:  €18.57
£39.74
List Price:  £55.64
You save:  £15.89
CA$68.36
List Price:  CA$95.72
You save:  CA$27.35
A$75.43
List Price:  A$105.61
You save:  A$30.18
S$67.50
List Price:  S$94.51
You save:  S$27
HK$390.66
List Price:  HK$546.96
You save:  HK$156.29
CHF 45.28
List Price:  CHF 63.39
You save:  CHF 18.11
NOK kr542.32
List Price:  NOK kr759.29
You save:  NOK kr216.97
DKK kr346.21
List Price:  DKK kr484.72
You save:  DKK kr138.51
NZ$83.04
List Price:  NZ$116.27
You save:  NZ$33.22
د.إ183.60
List Price:  د.إ257.06
You save:  د.إ73.45
৳5,477.48
List Price:  ৳7,668.91
You save:  ৳2,191.43
₹4,173.46
List Price:  ₹5,843.17
You save:  ₹1,669.71
RM236.90
List Price:  RM331.68
You save:  RM94.78
₦61,737.65
List Price:  ₦86,437.65
You save:  ₦24,700
₨13,884.75
List Price:  ₨19,439.77
You save:  ₨5,555.01
฿1,836.53
List Price:  ฿2,571.29
You save:  ฿734.76
₺1,613.79
List Price:  ₺2,259.44
You save:  ₺645.64
B$253.58
List Price:  B$355.04
You save:  B$101.45
R921.65
List Price:  R1,290.39
You save:  R368.73
Лв90.79
List Price:  Лв127.12
You save:  Лв36.32
₩67,757.86
List Price:  ₩94,866.43
You save:  ₩27,108.56
₪187.05
List Price:  ₪261.89
You save:  ₪74.83
₱2,856.96
List Price:  ₱3,999.98
You save:  ₱1,143.01
¥7,687.37
List Price:  ¥10,762.93
You save:  ¥3,075.56
MX$846.40
List Price:  MX$1,185.03
You save:  MX$338.62
QR182.04
List Price:  QR254.87
You save:  QR72.83
P679.94
List Price:  P951.97
You save:  P272.03
KSh6,711.15
List Price:  KSh9,396.15
You save:  KSh2,685
E£2,396.98
List Price:  E£3,355.96
You save:  E£958.98
ብር2,864.89
List Price:  ብር4,011.08
You save:  ብር1,146.18
Kz41,759.31
List Price:  Kz58,466.37
You save:  Kz16,707.06
CLP$47,049.08
List Price:  CLP$65,872.48
You save:  CLP$18,823.40
CN¥353.90
List Price:  CN¥495.49
You save:  CN¥141.59
RD$2,900.17
List Price:  RD$4,060.47
You save:  RD$1,160.30
DA6,724.18
List Price:  DA9,414.39
You save:  DA2,690.21
FJ$112.18
List Price:  FJ$157.07
You save:  FJ$44.88
Q387.94
List Price:  Q543.15
You save:  Q155.20
GY$10,441.17
List Price:  GY$14,618.48
You save:  GY$4,177.30
ISK kr6,976.60
List Price:  ISK kr9,767.80
You save:  ISK kr2,791.20
DH503.40
List Price:  DH704.80
You save:  DH201.40
L884.08
List Price:  L1,237.78
You save:  L353.70
ден2,857.75
List Price:  ден4,001.09
You save:  ден1,143.33
MOP$401.71
List Price:  MOP$562.43
You save:  MOP$160.71
N$923.86
List Price:  N$1,293.49
You save:  N$369.62
C$1,837.28
List Price:  C$2,572.34
You save:  C$735.06
रु6,663.84
List Price:  रु9,329.91
You save:  रु2,666.07
S/186.31
List Price:  S/260.85
You save:  S/74.53
K192.92
List Price:  K270.11
You save:  K77.18
SAR187.49
List Price:  SAR262.50
You save:  SAR75.01
ZK1,346.25
List Price:  ZK1,884.87
You save:  ZK538.61
L230.87
List Price:  L323.24
You save:  L92.36
Kč1,161.41
List Price:  Kč1,626.08
You save:  Kč464.66
Ft18,082.13
List Price:  Ft25,316.43
You save:  Ft7,234.30
SEK kr541.20
List Price:  SEK kr757.73
You save:  SEK kr216.52
ARS$43,928.30
List Price:  ARS$61,503.14
You save:  ARS$17,574.83
Bs345.62
List Price:  Bs483.90
You save:  Bs138.27
COP$194,235.29
List Price:  COP$271,944.94
You save:  COP$77,709.65
₡25,508.30
List Price:  ₡35,713.67
You save:  ₡10,205.36
L1,232.91
List Price:  L1,726.17
You save:  L493.26
₲373,633.39
List Price:  ₲523,116.65
You save:  ₲149,483.25
$U1,909.79
List Price:  $U2,673.86
You save:  $U764.07
zł200.70
List Price:  zł281
You save:  zł80.29
Already have an account? Log In

Transcript

Hello guys, welcome to the 11th session of the SP dotnet VBA tutorials. In this lesson we will learn about the immediate I formatter that are supported by the ESP dotnet have a VBA media type formatter, the base class which handles serializing and deserializing for the friendly type object. mediate a formula is a bridge between the HTTP and the controller. There are various type of familiar I formula are available, but most probably use media formula the Jason media type formatter and the extra media type formatter was in a most promiscuous and the supported media for the request is XML or the Jason let's fish to the postman plugin. Here is the result of the our GET request to redoing the all of the Data those all data are in India provided by the postman plug in itself not by the hour request. To view the original result of which are supplied by the web server, then we need to click on the arrow tab.

Here is the result which is originally sent by the our server, which does not specify the any indent and the new line for the our response. To provide the property name, we need to make the changes let's switch to Visual Studio. Open the VBA configuration file that available in the app underscore start. deftly configure jetties are responsible for that, which is the instance of the HTTP configuration. We need to write the config dot formatters which were written the all of the formulas supported by the Over APA, from which we need to write code on the Jason formatter which contain the methods and the property for during the hour Jason format, from which you will need to select the serializing setting Lord parameters formatting equal to intended click on the run button. Let's switch to the postman and click on the Send request.

And here is the output in which all of the property are in the new line as well as the all property are at the proper indent. Here each of the property are in the A capitalized case which was present In the our database, but what happened if you want to return in the camel case instead of the capitalized case. For that you can specify the setting to the configuration config dot formatter dot Jason formatter door serializing setting door content for Sawa equal to new camelcase property name resolver. That's it, it will automatically convert the all of the property name into the capitalized case. You can see that the all of the property now started with the lowercase Instead of the uppercase India certain situation many property contain the null value in that situation you want to hide that the entire property from the response and you can also do that with the formatter.

However in the our case all of the property can do value. To do that, we need to write the configuration God formatter, Jason formatter dot serializing setting not null value handling equal to null value handling ignore which will automatically remove the all of the property which contain the null values which was helpful in the certain situation. Let's see the XML response in the row format. For that we need to specify the Accept header. xml and click on Send. You can see that the like the Jason it also specify the all of the data in the single line without the appropriate indent.

To providing the intent to the XML we need to use the XML media type formatter. For that, we need to write the config dot formatters d'Or XML formatter. Here is the list of the property and the method for formatting the XML we need to use the intent property and to specify the boolean value. We are using the a true for providing the intent plenty so listen Switch to postman and click on the send button. Here you can see that do now all of the tags are arranged in the proper intent. We can also remove the any formula from the configuration.

For that we need to write the configuration dot formatters dot remove and specify the configuration name that is a configuration dot formatters dot XML. Now it will remove the XML formatting from the auto configuration Click on the sign up button. You can see that even vs specify the application slash XML as the Accept header, simply return the JSON format because have we already removed the XML media type formatter, so it will automatically use the Jason formatter. We can also create do one custom media type formatter and add it into the separate media type. For that we need to write the config dot formatters dot add and the our custom date formatter name that is custom for me Oh we have not created any custom formula that's why producing the error for creating the custom formula we need to accent it from the immediate formatter class. If you check the Jason media type format or the XML media type formatter class definition then you may observe that both are excellent from the immediate a formatter directory or the index tree.

Let's see it go to definition it written the excellent read a formatter rightly click on the go to definition you can see that the SMM Maria de forma is excellent from the immediate formatter. Same for the Jason formatter. How itself XM from the media type formatter. For creating the custom media type formatter we need to accent the overclass from the media type formatter and the override the some of those methods such as a country can right This emulator formatter represent the data for meta class for handling the Jason which provides the various configurations such as formatting, intent formatting now this immediate formatted Jason media type formatter represent the immediate formatter for handling the ages and which provide the various settings for the response such as the formatting for the intent value, null value handling, and the changing the keys or the property by using the camel case property.

By using a separate I place where we can specify the list of the MA type data value which are supported by that format or XML media type formatter represent the data formatter class for handling the XML for setting up the XML data format, we need to use the configuration dot formatter dot XML media type formatter and use the any property for that parameter. In this case we are using as the indent. We can also add the our custom media type format as well as the remove the existing media type formatter. We can also add the custom media type formatter by using the config dot parameters dot add our media type formatter name. And for removing the media type formatter, we need to use the config dot formatter dot remove method. Thanks for watching.

Have a nice day.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.