1024programmer Java PHPrestful cross-domain, restful, jquery_RESTful under IIS7.5 cannot cross-domain PUT and POST, restful, jquery, javascript, cross-domain phpStudy…

PHPrestful cross-domain, restful, jquery_RESTful under IIS7.5 cannot cross-domain PUT and POST, restful, jquery, javascript, cross-domain phpStudy…

RESTful under IIS7.5 cannot cross-domain PUT and POST

The test with Postman was successful,but the test failed in the jQuery code written by myself

Get&# xff0c;But PUT and POST cannot be performed

The following settings have been made for web.config in IIS7.5

jQuery code

$.ajax({

url: 'http://xxx.xxx.xxx.xxx:nnnn/api/apps/791',

type: 'PUT' ,

data: '{“Name”: “Tom”}',

dataType: 'json',

contentType: 'application/json',

crossDomain: true,

beforeSend: function( xhr ) {

xhr. setRequestHeader('X-Requested-With', 'jQuery');

},

success: function(response) {

} p>

console.log('ok');

}

});

Browser Chrome 53

General

Request URL:http://XXX.XXX.XXX.XXX:10088/api/apps/791

Request Method:OPTIONS

Status Code:405 Method Not Allowed

Remote Address:XXX.XXX.XXX.XXX:10088

Response Headers

Access-Control-Allow -Headers:X-Requested-With

Access-Control-Allow-Methods:GET, PUT, POST, DELETE, OPTIONS

Access-Control-Allow-Origin:*

Allow:PUT,GET

Cache-Control:no-cache

Content-Length:66

Content-Type: application/json ; charset=utf-8

Date:Tue, 13 Sep 2016 02:00:41 GMT

Expires:-1

Pragma:no- cache

Server:Microsoft-IIS/7.5

X-AspNet-Version:4.0.30319

X-Powered-By:ASP.NET

Request Headers

Accept:*/*

Accept-Encoding:gzip, deflate, sdch

Accept-Language:zh-CN,zh ;q=0.8,en;q=0.6,ja;q=0.4,zh-TW;q=0.2

Access-Control-Request-Headers:content-type , x-requested-with

Access-Control-Request-Method:POST

Connection:keep-alive

Host:XXX.XXX.XXX.XXX :10088

Origin:http://XXX.XXX.XXX.YYY:7788

Referer:http://XXX.XXX.XXX.YYY:7788/jqdebug.html

User-Agent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.101 Safari/537.36

Related reading:

Webuploader plug-in ie9 error reporting problem

fs.createReadStream(filepath).pipe(response); What does this sentence mean?

Input under IOS The keyboard cannot be evoked after the element is focused

Vue2.0 brother component communication ,data transfer is successful,but the data of the component cannot be changed

ajax velocity front-end uses velocity in Is there any difference between rendering data in HTML and requesting data in JS using ajax? Different js servers?

Why does this select query in mysql return empty data?

How to use runtime to obtain the UIApplication singleton and call its method?

How does vue pass the current element index to the function

How to pass an inner class object through an outer class object?

How to understand the following Clear float of code

Regular expression matching problem

How to mix vue.js and jquery

iframe scaling causes input focus position error

Atom software problem

Please tell me how to write the structure of the two routers in vue-router

The problem of jasmine-node writing unit test method is not defined

How to refresh Laravel Caching?

Setting the border-radius and overflow of the element’s CSS at the same time will have an impact

This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/phprestful-cross-domain-restful-jquery_restful-under-iis7-5-cannot-cross-domain-put-and-post-restful-jquery-javascript-cross-domain-phpstudy/

author: admin

Previous article
Next article

Leave a Reply

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

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: 34331943@QQ.com

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索