相关疑难解决方法(0)

带有 REST Post 请求的 415(不支持的媒体类型)

我有一个反应组件,当按下复选框时,它会调用一个休息 api,使用单个参数发布请求。

我在 webapi 中放置了一个断点并且它从未命中,但我仍然在组件上获得了 415 unsopported 媒体类型

react js component (see onchange event)

import React, { Component } from 'react';
import {  Table, Radio} from 'antd';
import { adalApiFetch } from '../../adalConfig';
import Notification from '../../components/notification';

class ListTenants extends Component {

    constructor(props) {
        super(props);
        this.state = {
            data: []
        };
    }



    fetchData = () => {
        adalApiFetch(fetch, "/Tenant", {})
          .then(response => response.json())
          .then(responseJson => {
            if (!this.isCancelled) {
                const results= responseJson.map(row => ({
                    key: row.ClientId,
                    ClientId: row.ClientId,
                    ClientSecret: row.ClientSecret, …
Run Code Online (Sandbox Code Playgroud)

javascript jquery asp.net-web-api reactjs asp.net-web-api2

7
推荐指数
2
解决办法
1万
查看次数