Which code segment should you insert at line 05?

You develop a web application by using jQuery. You develop the following jQuery code:
(Line numbers are included for reference only.)

The web application exposes a RESTful web API that has an endpoint of/product/create.
You need to create a new product by using AJAX.
Which code segment should you insert at line 05?

You develop a web application by using jQuery. You develop the following jQuery code:
(Line numbers are included for reference only.)

The web application exposes a RESTful web API that has an endpoint of/product/create.
You need to create a new product by using AJAX.
Which code segment should you insert at line 05?

A.
Option A

B.
Option B

C.
Option C

D.
Option D



Leave a Reply 5

Your email address will not be published. Required fields are marked *


Madhacker

Madhacker

D is correct

yoyomismo

yoyomismo

It’s is B, web api, return is GET, the web api can return XML.

Sihle

Sihle

I agree with Madhacker the correct answer is D, yoyomismo the method should be POST and not GET

viorel

viorel

“You need to create a new product by using AJAX” – for create a product need POST method

brkyctn

brkyctn

Explanation/Reference:
* url: /product/create
This is the endproduct.
* datatype:
The type of data that you’re expecting back from the server.
* contentType (default: ‘application/x-www-form-urlencoded; charset=UTF-8’)
Reference: jQuery.ajax()