Customize Method Names

3 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
€42.65
List Price:  €59.72
You save:  €17.06
£36.50
List Price:  £51.10
You save:  £14.60
CA$68.38
List Price:  CA$95.74
You save:  CA$27.35
A$76.61
List Price:  A$107.26
You save:  A$30.65
S$63.74
List Price:  S$89.24
You save:  S$25.50
HK$392.41
List Price:  HK$549.41
You save:  HK$156.99
CHF 39.86
List Price:  CHF 55.81
You save:  CHF 15.94
NOK kr504.81
List Price:  NOK kr706.78
You save:  NOK kr201.96
DKK kr318.24
List Price:  DKK kr445.56
You save:  DKK kr127.32
NZ$82.49
List Price:  NZ$115.49
You save:  NZ$33
د.إ183.58
List Price:  د.إ257.03
You save:  د.إ73.45
৳6,111.94
List Price:  ৳8,557.21
You save:  ৳2,445.26
₹4,287.14
List Price:  ₹6,002.34
You save:  ₹1,715.20
RM210.48
List Price:  RM294.69
You save:  RM84.21
₦77,095.07
List Price:  ₦107,939.27
You save:  ₦30,844.20
₨14,173.24
List Price:  ₨19,843.67
You save:  ₨5,670.43
฿1,625.19
List Price:  ฿2,275.40
You save:  ฿650.21
₺1,989.83
List Price:  ₺2,785.93
You save:  ₺796.09
B$274.44
List Price:  B$384.24
You save:  B$109.80
R888.74
List Price:  R1,244.30
You save:  R355.56
Лв83.37
List Price:  Лв116.73
You save:  Лв33.35
₩67,716.55
List Price:  ₩94,808.60
You save:  ₩27,092.04
₪168.48
List Price:  ₪235.88
You save:  ₪67.40
₱2,821.78
List Price:  ₱3,950.72
You save:  ₱1,128.94
¥7,211.91
List Price:  ¥10,097.25
You save:  ¥2,885.34
MX$943.03
List Price:  MX$1,320.32
You save:  MX$377.29
QR182.15
List Price:  QR255.02
You save:  QR72.87
P668.10
List Price:  P935.39
You save:  P267.29
KSh6,458.70
List Price:  KSh9,042.70
You save:  KSh2,584
E£2,479.34
List Price:  E£3,471.28
You save:  E£991.93
ብር6,750.83
List Price:  ብር9,451.70
You save:  ብር2,700.87
Kz45,588.63
List Price:  Kz63,827.73
You save:  Kz18,239.10
CLP$46,560.32
List Price:  CLP$65,188.17
You save:  CLP$18,627.85
CN¥358.13
List Price:  CN¥501.42
You save:  CN¥143.28
RD$2,972.99
List Price:  RD$4,162.43
You save:  RD$1,189.43
DA6,468.12
List Price:  DA9,055.89
You save:  DA2,587.76
FJ$112.01
List Price:  FJ$156.83
You save:  FJ$44.81
Q384.32
List Price:  Q538.08
You save:  Q153.76
GY$10,450.50
List Price:  GY$14,631.53
You save:  GY$4,181.03
ISK kr6,065.28
List Price:  ISK kr8,491.88
You save:  ISK kr2,426.60
DH451.19
List Price:  DH631.71
You save:  DH180.51
L846.29
List Price:  L1,184.88
You save:  L338.58
ден2,623.04
List Price:  ден3,672.46
You save:  ден1,049.42
MOP$404.09
List Price:  MOP$565.76
You save:  MOP$161.67
N$894.91
List Price:  N$1,252.95
You save:  N$358.03
C$1,839.08
List Price:  C$2,574.86
You save:  C$735.78
रु6,837.12
List Price:  रु9,572.52
You save:  रु2,735.39
S/177.37
List Price:  S/248.33
You save:  S/70.96
K206.13
List Price:  K288.60
You save:  K82.47
SAR187.48
List Price:  SAR262.49
You save:  SAR75.01
ZK1,183.09
List Price:  ZK1,656.43
You save:  ZK473.33
L216.58
List Price:  L303.23
You save:  L86.65
Kč1,055.43
List Price:  Kč1,477.69
You save:  Kč422.25
Ft17,045.41
List Price:  Ft23,864.94
You save:  Ft6,819.53
SEK kr474.96
List Price:  SEK kr664.98
You save:  SEK kr190.02
ARS$59,400.36
List Price:  ARS$83,165.26
You save:  ARS$23,764.89
Bs345.29
List Price:  Bs483.43
You save:  Bs138.14
COP$201,871.90
List Price:  COP$282,636.81
You save:  COP$80,764.91
₡25,203.72
List Price:  ₡35,287.23
You save:  ₡10,083.50
L1,305.74
List Price:  L1,828.15
You save:  L522.40
₲398,786.69
List Price:  ₲558,333.27
You save:  ₲159,546.58
$U2,009.55
List Price:  $U2,813.53
You save:  $U803.98
zł180.94
List Price:  zł253.33
You save:  zł72.39
Already have an account? Log In

Transcript

Hello guys, welcome to the trading session OBS we don't need a VBA to. In this session we will learn about the how to customize the method name. By default the HTTP verb will match to the method name in a controller that has the same name or the shot with the verb. means that the method with dnm CAD get product get our product will match to the HTTP verb get. And the meta name post and post product will match to the editor we will post but what if you want to use the different name for the method for example, instead of using the product name for the matter you want to use the load or products for the mF and that will map to the ITV get legendary should with the examples we should visit studio. Let's modify the get method name to the old all products and build our solution switch to postman.

Remove the unnecessary parameters and send the get request to retrieve all of the products. You can see that the request has is a four zero file that is a method not allowed. This error occur because the as we don't have baby pay we'll try to find the a method with the name get or start with the gap which does not have the any parameter. In the our case there is only one good method however it contained the parameter so it does not map to that and it will enter the 405 method. We need to specify the VPI that our lower product method will be used as the get method. For that we need to use the follies we need to use the ITP get attribute.

Let's rebuild the solution. Switch to postman and click on the Send request. You can see that it written all of the product as the expected. Like the HTTP GET attribute, we can also use the HTTP POST put and delete attribute for the respected methods. Along with that, we can also use the acceptable attribute which allows us to specify the multiple HTTP methods. Let's see.

Instead of using the cat as a method name, I am going to use the load product with ID has a method name and use the Accept for attribute and specify the list of the Did we matter let us the I get as well as the post, but it will be of a solution. Switch to postman. Specify the ID that is a 10. Click on DSN to ensure that it will return the product detail with the target matter. And now we're going to select the post and click on the yes and it also written the detailing the apportion method to we need to specify the attribute at the method level. We can use the HTTP GET post, put and delete as well as the except for in which we need to specify the method name.

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.