问题描述
我有一个 ping Django 后端的 HTTP post 请求。当从 Postman 发出请求时,我能够得到有效的响应。但是从 Chrome 触发,使用语义相同的 json 负载,我收到 400 错误请求。
以下是我使用的 json 模型,以 angular 构建主体。
标题保持不变,授权也完全相同(使用基本身份验证)。我唯一能想到的问题是 CORS,但是,我正在代理它来解决这个问题。
export class RealResult {
node: string;
source: string;
destination: string;
protocol: string;
source_port: string;
destination_port: string;
direction: string;
acl_ID: string;
zone: string;
action: string;
timestamp: string;
flowID: string;
constructor(data: RealResult) {
this.node = data.node;
this.source = data.source;
this.destination = data.destination;
this.protocol = data.protocol;
this.source_port = data.source_port;
this.destination_port = data.destination_port;
this.direction = data.direction;
this.acl_ID = data.acl_ID;
this.zone = data.zone;
this.action = data.action;
this.timestamp = data.timestamp;
this.flowID = data.flowID
}
}
export class Success {
results: Result[];
constructor() {
this.results = []
}
}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)