我正在尝试使用typescript JsonServiceClient配置servicestack CorsPlugin。 客户端代码如下所示:
const client = new JsonServiceClient( 'http://localhost:5000' );
client.password = 'password';
client.userName = 'username';
client.get( new Authenticate() ).then( (authRes) => {
console.log( authRes );
let req = new CreateAccount();
client.bearerToken = authRes.bearerToken;
req.mail = 'demo';
client.post( req ).then( (res) => {
console.log( res );
} );
} );

Plugins.Add(new CorsFeature(
allowedMethods: "GET, POST, PUT, DELETE, OPTIONS",
allowedHeaders: "Content-Type, Allow, Authorization",
allowCredentials: true,
allowOriginWhitelist: new[]
{"http://localhost:3000", "https://www.app.production.com"}));

当客户端发送请求时,它认为是GET但在控制台中它显示为OPTIONS,并且实际接收数据。所以它有点运行,但没有正确的http动词。任何人都可以建议我做错了什么?感谢