headers (default: {}) Type: PlainObject An object of additional header key/value pairs to send along with requests using the XMLHttpRequest transport. The header X-Requested-With: XMLHttpRequest is always added, but its default XMLHttpRequest value can be changed here. Values in the headers setting can also be overwritten from within the beforeSend function. (version added: 1.5)
data Type: PlainObject or String or Array Data to be sent to the server. It is converted to a query string, if not already a string. It's appended to the url for GET-requests. See processData option to prevent this automatic processing. Object must be Key/Value pairs. If value is an Array, jQuery serializes multiple values with same key based on the value of the traditional setting (described below).
文档里说了,apikey作为请求参数是放在header里传递的。
使用jquery的话可以查看官方文档添加header的方法:
而ip参数则正常地放在url Param里传递
http://api.jquery.com/jquery.ajax/
在请求地址后面加上参数:
url?apikey=&ip=
想知道不用jQuery用原生js能不能使用apikey,怎么使用?