Salesforce Certified Platform Developer II — Question 33
What is a valid request for the following REST method? (Choose two.)
@HttpPost global static void myPostMethod(String sl, Integer il, Boolean bl, String 52)
Answer options
- A. <request> <sl>my first string</sl> <11>123</il> <32>my second string</32> <b1>false</bl> </request>
- B. <request> <sl>"my first string"</sl> <il>123</il> <sZ>"my second string"</32> <bl>false</bl> </request>
- C. sl" : "my first string", 11" : "123", "b1" : "false", "S2" : "my second string"
- D. il" : 123, "S1" : "my first string", "S2" : "my second string", "bl" : false
Correct answer: B, D
Explanation
Option B is valid as it correctly uses XML format with the right tags for the parameters. Option D is also valid because it uses a JSON-like structure, correctly matching the expected parameter types. Options A and C are incorrect due to incorrect tag names and missing proper formatting, making them invalid requests.