Facing issue while calling post method from angular

Madhukar Devale

I am calling post web api method from angular but getting below error: "Failed to load : Response for preflight has invalid HTTP status code 404" I have enabled allow for cross origin request.

See below code:

 return this._http.post("http://localhost:64575/api/Rules", 
{
  currentPage: 1,
  pageSize: 10,
  sortColumn: 'id',
  sortDirection: 'asc'      
}, requestOptions)    
.map(res=>res.json());     
Arihant Jain

Whenever you issue a Post request 2 calls are made to server

  1. Call with "Options" request method
  2. Actual post call

Now you need to handle "Options" call on your API implementation Reference link: Handling CORS Preflight in Asp.net Web API

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

POST method not working in .NET Core MVC while using Jquery , AJAX for calling api from View(html page)?

From Dev

Facing warning issue while debugging

From Dev

Facing issue while login redirect

From Dev

Facing issue while calling @viewchild in angular

From Dev

Facing connection issue while running copy in Vertica

From Dev

Facing issue while POST when it has no payload (python code)

From Dev

NullPointerException while calling a method from service

From Dev

Issue while calling a static Method in jsp

From Dev

Facing parse error issue with google plusDomains rest api while creating post

From Dev

Facing issue with MFA while adding account to Yodlee

From Dev

Facing issue while deserializing the http resposne

From Dev

Facing issue "Error Code: EPERM" while conducting a build for hawtio which includes typescript and Angular files

From Dev

facing issue while populating/referencing the variable in shell

From Dev

Facing Issue while sending data from Filebeats to Multiple Logstash files

From Dev

Facing issue while starting Controller in Docker

From Dev

Facing urlencoding issue while processing request

From Dev

POST method calling from service Angular 6 to the REST using web api in asp.net mvc

From Dev

facing issue while formating the JSON Data

From Dev

Calling a method while shifting tab - angular

From Dev

NodeJs facing the issue while using async waterfall

From Dev

Segmentation fault while calling a method from a pointer

From Dev

Facing issue while sending "&" in a string

From Dev

Facing issue while installing Cassandra on MacOs

From Dev

Facing issue while running Daml scenarios

From Dev

Facing error while calling OnehopEngine SDK Huawei

From Dev

Facing issue while installing ruamel.yaml

From Dev

Facing issue while executing the groovy code in JMeter

From Dev

Facing issue while executing the Groovy code

From Dev

Facing an issue while learning logical ML

Related Related

  1. 1

    POST method not working in .NET Core MVC while using Jquery , AJAX for calling api from View(html page)?

  2. 2

    Facing warning issue while debugging

  3. 3

    Facing issue while login redirect

  4. 4

    Facing issue while calling @viewchild in angular

  5. 5

    Facing connection issue while running copy in Vertica

  6. 6

    Facing issue while POST when it has no payload (python code)

  7. 7

    NullPointerException while calling a method from service

  8. 8

    Issue while calling a static Method in jsp

  9. 9

    Facing parse error issue with google plusDomains rest api while creating post

  10. 10

    Facing issue with MFA while adding account to Yodlee

  11. 11

    Facing issue while deserializing the http resposne

  12. 12

    Facing issue "Error Code: EPERM" while conducting a build for hawtio which includes typescript and Angular files

  13. 13

    facing issue while populating/referencing the variable in shell

  14. 14

    Facing Issue while sending data from Filebeats to Multiple Logstash files

  15. 15

    Facing issue while starting Controller in Docker

  16. 16

    Facing urlencoding issue while processing request

  17. 17

    POST method calling from service Angular 6 to the REST using web api in asp.net mvc

  18. 18

    facing issue while formating the JSON Data

  19. 19

    Calling a method while shifting tab - angular

  20. 20

    NodeJs facing the issue while using async waterfall

  21. 21

    Segmentation fault while calling a method from a pointer

  22. 22

    Facing issue while sending "&" in a string

  23. 23

    Facing issue while installing Cassandra on MacOs

  24. 24

    Facing issue while running Daml scenarios

  25. 25

    Facing error while calling OnehopEngine SDK Huawei

  26. 26

    Facing issue while installing ruamel.yaml

  27. 27

    Facing issue while executing the groovy code in JMeter

  28. 28

    Facing issue while executing the Groovy code

  29. 29

    Facing an issue while learning logical ML

HotTag

Archive