带主体的POST请求的IIS / Azure App Service重写规则

时间:2019-04-11 19:16:23

标签: node.js json post iis url-rewriting

我有一个运行Node.JS应用程序的Azure应用服务实例。 import { MiddlewareAPI, Dispatch, Middleware, AnyAction } from "redux"; const callAPIMiddleware: Middleware<Dispatch> = ({ dispatch }: MiddlewareAPI) => next => (action: AnyAction | CallApiAction) => { if (!action.meta || !action.meta.callApi) { return next(action); } const { successAction, errorAction, url, params } = action.payload; return fetchFn(url, params) .then(res => res.json()) .then(res => dispatch({ type: successAction, payload: res }) ) .catch(res => dispatch({ type: errorAction, payload: res }) ); }; 文件中有一条重写规则,该规则将所有传入请求路由到应用程序的入口点web.config

如果没有正文,则重写规则仅拾取/entry/sever.js个请求。如果它们有主体,则我在日志中会收到一个POST错误,提示服务器无法容纳该请求。

需要明确的是,我知道问题不在于应用程序本身。 IIS不能将我的随身POST请求路由到应用程序或其他任何地方。

那么,我如何创建一个重写规则来容纳带有正文的404请求?具体来说,我需要能够将包含应用程序/ json数据的POST传递给应用程序。

我的web.config文件:

POST

0 个答案:

没有答案