小编HBR*_*HBR的帖子

AWS API网关 - CORS + POST无法正常工作

CORS真的让我发疯,我真的没有想法让它变得有用.

我创建了一个简单的APIG Api,其中包含1个名为'abc'的资源,并添加了2个方法GETPOST,其中Authorization设置为NONE,API Key Required设置为false,所有内容都部署到名为'dev'的阶段.

当然,我在两种方法上都启用了CORS,我看到在OPTIONS方法和Access-Control-Allow-中添加了3个标题Access-Control-Allow-Origin,Access-Control-Allow-HeadersAccess-Control-Allow-Methods Origin添加到POSTGET方法中.

两个调用都映射到相同的lambda函数,该函数只是将"Hello from Lambda"文本输出到控制台.

然后我创建了一个简单的html页面,我在S3上作为静态网站托管,使用Route53指向一个域,并开始使用jQuery $ .ajax测试API 来进行调用.

一切看起来都很简单,直截了当,正如文档中所解释的那样,除了GET工作并按预期将文本输出到控制台.该POST版本导致以下错误:

No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://example.com' is therefore not allowed access. The response had HTTP status code …

api amazon-web-services cors aws-api-gateway

20
推荐指数
6
解决办法
1万
查看次数

无法向内容类型添加新字段,窗口小部件下拉列表无法正常工作

这是我与drupal的第一步.

我已经为我的文章创建了分类法层次结构,现在我正在尝试向内容类型"文章"和"媒体"添加新字段,以便内容管理员可以为其新内容指定"类别".

所以我去过Structure> Content Types> Article> Manage Fields然后"Add new field":

1- Label = Category
2- Name = "field_category
3- Field = "Term reference"
**4- Automatically changes to "Select list" but I am unable to see the drop down list options. Clicking the list doesn't do anything, I couldn't select Autocomplete or any other value I've seen on forums & tutorials. Using firebug I could see the options are there, but the list doesn't show up.**
Run Code Online (Sandbox Code Playgroud)

所有类型的字段都会发生这种情况,即使是文本字段也是最基本的字段.知道为什么会这样吗?

drupal-7

5
推荐指数
2
解决办法
1852
查看次数