当我发送这个ajax rquest时:
$.ajax({
headers : {
'Accept' : 'application/json',
'Content-Type' : 'application/json'
},
url : 'http://localhost:8080/wutup/venues/12',
type : 'PATCH',
data : JSON.stringify({description: "842490812321309213801923 gonzagazors"}),
success : function(response, textStatus, jqXhr) {
console.log("Venue Successfully Patched!");
},
error : function(jqXHR, textStatus, errorThrown) {
// log the error to the console
console.log("The following error occured: " + textStatus, errorThrown);
},
complete : function() {
console.log("Venue Patch Ran");
}
});
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
XMLHttpRequest无法加载http:// localhost:8080/wutup/venues/12.Access-Control-Allow-Methods不允许使用PATCH方法.
但是,使用curl:
$ curl -v -H "Accept: application/json" -H "Content-type: application/json" -X PATCH …
Run Code Online (Sandbox Code Playgroud) 我正在使用一个干净的Ubuntu服务器实例,并希望在我的virtualenv中安装一些python包.
我从命令'pip install -r requirements.txt'收到以下输出
Downloading/unpacking pymongo==2.5.2 (from -r requirements.txt (line 7))
Downloading pymongo-2.5.2.tar.gz (303kB): 303kB downloaded
Running setup.py egg_info for package pymongo
Traceback (most recent call last):
File "<string>", line 3, in <module>
ImportError: No module named setuptools.command
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 3, in <module>
ImportError: No module named setuptools.command
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /home/redacted/env/build/pymongo
Storing complete log in …
Run Code Online (Sandbox Code Playgroud)