Guest User

Untitled

a guest
Oct 21st, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. var cors = new EnableCorsAttribute(origins:"*",methods: "*", headers: "*");
  2. config.EnableCors(cors);
  3.  
  4. [Route("SaveorUpdateCategory")]
  5. [HttpPost]
  6. public IHttpActionResult SaveorUpdateCategory(ModelCategory model)
  7. {
  8. string res = objcate.SaveorUpdateCategory(model);
  9. return Ok(res);
  10.  
  11. }
  12.  
  13. SaveorUpdateCategory( model: any): Observable<any> {
  14. this.headers= new Headers({ 'Content-Type': 'application/json' })
  15. this.options = new RequestOptions({ headers: this.headers });
  16. let body = JSON.stringify(model);
  17. return this._http.post(this.BaseURL+"Category/SaveorUpdateCategory", model, this.options)
  18. .map((response: Response) => <any>response.json())
  19. .catch(this.handleError);
Add Comment
Please, Sign In to add comment