Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Model
- {
- public int WeekID { get; set; }
- }
- [HttpPost]
- public IHttpActionResult AddHour(Hour hour)
- {
- return Ok();
- }
- export const SaveWeek s= weekData=> {
- const headers = new Headers();
- headers.append("Content-Type", "application/json");
- const Week= {
- method: "POST",
- headers,
- mode: "cors",
- body: weekData
- };
- console.log("Hours:");
- // Returns {"WeekID": 1}
- console.log(Hours.body);
- return axios.post("http://localhost:52350/api/REST/AddHour", {
- Week
- });
- };
- [HttpPost]
- public IHttpActionResult AddHour(Hour hour)
- {
- // This returns a string in which the data that I sent
- // can be found.
- string body = Request.Content.ReadAsStringAsync().Result;
- return Ok();
- }
Add Comment
Please, Sign In to add comment