小编Sam*_*Sam的帖子

jQuery ajax调用是否支持PATCH?

当我发送这个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)

javascript ajax jquery patch

29
推荐指数
1
解决办法
5万
查看次数

Pip安装错误.Setuptools.com找不到

我正在使用一个干净的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)

python pip pymongo python-2.7

15
推荐指数
2
解决办法
3万
查看次数

标签 统计

ajax ×1

javascript ×1

jquery ×1

patch ×1

pip ×1

pymongo ×1

python ×1

python-2.7 ×1