• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript axios.put函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中axios.put函数的典型用法代码示例。如果您正苦于以下问题:TypeScript put函数的具体用法?TypeScript put怎么用?TypeScript put使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了put函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。

示例1: it

            it('Should stub and find multiple requests by method', (done) => {
                moxios.stubOnce('PUT', '/users/12345', {
                    status: 204
                });

                moxios.stubOnce('GET', '/users/12346', {
                    status: 200,
                    response: USER_FRED
                });

                axios.put('/users/12345', USER_FRED).then(onFulfilled);
                axios.get('/users/12346', {}).then(onFulfilled);

                moxios.wait(() => {
                    equal(onFulfilled.calledTwice, true);

                    let response1 = onFulfilled.getCall(0).args[0];
                    let response2 = onFulfilled.getCall(1).args[0];
                    equal(response1.status, 204);
                    equal(response2.status, 200);
                    equal(response2.data.firstName, 'Fred');

                    let request = moxios.requests.get('PUT', '/users/12345');
                    notEqual(request, undefined);

                    request = moxios.requests.get('GET', '/users/12346');
                    notEqual(request, undefined);

                    done();
                });
            });
开发者ID:Crevil,项目名称:DefinitelyTyped,代码行数:31,代码来源:moxios-tests.ts


示例2: dispatch

 return async dispatch => {
   await dispatch({
     type: ACTION_TYPES.FETCH_LOGS_CHANGE_LEVEL,
     payload: axios.put('/management/jhipster/logs', body)
   });
   dispatch(getLoggers());
 };
开发者ID:tporadowski,项目名称:generator-jhipster,代码行数:7,代码来源:administration.ts


示例3: fromPromise

 put<T = any>(
   url: string,
   data?,
   config?: AxiosRequestConfig,
 ): Observable<AxiosResponse<T>> {
   return fromPromise(axios.put(url, data, config));
 }
开发者ID:a1r0,项目名称:nest,代码行数:7,代码来源:http.service.ts


示例4: dispatch

export const updateEntity: ICrudPutAction<IDialogue> = entity => async dispatch => {
  const result = await dispatch({
    type: ACTION_TYPES.UPDATE_DIALOGUE,
    payload: axios.put(apiUrl, cleanEntity(entity))
  });
  dispatch(getEntities());
  return result;
};
开发者ID:gjik911,项目名称:git_01,代码行数:8,代码来源:dialogue.reducer.ts


示例5: dispatch

export const updateEntity: ICrudPutAction<IFlockRelation> = entity => async dispatch => {
  const result = await dispatch({
    type: ACTION_TYPES.UPDATE_FLOCKRELATION,
    payload: axios.put(apiUrl, cleanEntity(entity))
  });
  dispatch(getEntities());
  return result;
};
开发者ID:gjik911,项目名称:git_01,代码行数:8,代码来源:flock-relation.reducer.ts


示例6: dispatch

export const updateEntity: ICrudPutAction<ICurrentMessage> = entity => async dispatch => {
  const result = await dispatch({
    type: ACTION_TYPES.UPDATE_CURRENTMESSAGE,
    payload: axios.put(apiUrl, cleanEntity(entity))
  });
  dispatch(getEntities());
  return result;
};
开发者ID:gjik911,项目名称:git_01,代码行数:8,代码来源:current-message.reducer.ts


示例7: dispatch

export const updateUser: ICrudPutAction<IUser> = user => async dispatch => {
  const result = await dispatch({
    type: ACTION_TYPES.UPDATE_USER,
    payload: axios.put(apiUrl, user)
  });
  dispatch(getUsers());
  return result;
};
开发者ID:gjik911,项目名称:git_01,代码行数:8,代码来源:user-management.reducer.ts


示例8: dispatch

export const updateEntity: ICrudPutAction<ICustomerFlock> = entity => async dispatch => {
  const result = await dispatch({
    type: ACTION_TYPES.UPDATE_CUSTOMERFLOCK,
    payload: axios.put(apiUrl, cleanEntity(entity))
  });
  dispatch(getEntities());
  return result;
};
开发者ID:gjik911,项目名称:git_01,代码行数:8,代码来源:customer-flock.reducer.ts


示例9: update

 update(entity: T): Promise<T> {
     const entityId = entity.id;
     entity = this.mapper.removeId(entity);
             
     return axios
         .put(`${this.endPointUrl}/${this.collectionName}/${entityId}.json`, entity)
         .then(response => response.data);
 }
开发者ID:danilobjr,项目名称:crud-react-redux-ts,代码行数:8,代码来源:CrudGeneric.ts


示例10: Promise

 return new Promise((resolve, reject) => {
   Axios.put(url, request, options)
     .then(response => {
       resolve(response.data)
     })
     .catch(e => {
       reject(e)
     })
 })
开发者ID:tic40,项目名称:archives,代码行数:9,代码来源:methods.ts



注:本文中的axios.put函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript axios.request函数代码示例发布时间:2022-05-25
下一篇:
TypeScript axios.post函数代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap