當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript axios.put函數代碼示例

本文整理匯總了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;未經允許,請勿轉載。