HOTSPOT
You are developing a web application that retrievesdata from a web service.
The data being retrieved is a custom binary datatype named bint. The data can also be represented in XML.
Two existing methods named parseXml() and parseBint() are defined on the page.
The application must:
Retrieve and parse data from the web service using binary format if possible
Retrieve and parse the data from the web service using XML when binary format is not possible
You need to develop the application to meet the requirements.
What should you do? (To answer, select the appropriate options from the drop-down lists in the answer area.)
A.
for first option, I think the correct answer is “contentType: ‘application/bint, text/xml’,”
Is it right?
since contentType is an attrib of response and accept is an attrib of the request, the answer is correct
Accepts:
A set of key/value pairs that map a given dataType to its MIME type.
while
DataType: The type of data that you’re expecting back from the server, and it is a string.
I think Datatype is the right answer
Accept allows to set key-value pair response data, dataType is also for response data but a short hand such as “json” but it’s equvivalent accept header would be “text/json”.
Content-Type is for Request data.
In 1st dropdown, accepts:’application/bint,text/xml’
In 2nc dropdown, if(request.getResponseHeader…