'How to send two objects using Axios put request to service
I want to hit a service which looks like:
[HttpPut]
public void UpdateData(UserData parameter1, UserData parameter2)
{
//some code
}
To hit the service I am using Type Script and Axios (code is below) which I understand is wrong
async updateData(parameter1: UserData, parameter2: UserData): Promise<AxiosPromise<any>> {
let res = null;
res = await this.api.put("api/admin/Users/UpdateData/",{parameter1, parameter2 })
return res.data;
}
What should be the correct axios request to hit the service?
Note: UserData is a class
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|