WebAPI call working in Postman, returning 404 error on website - asp.net-web-api

I am having an odd issue. When I call my webapi service from Postman, it works:
but when I call it from within my browser (or from within the app), it returns a 404 error:
Anyone have any idea what might be happening here?

Related

Forbidden 403 Access URL API in Laravel

Good afternoon, let me ask
I created a service API using Laravel, but one of the API urls when I sent the response parameter was 403 or Forbidden. even though before it was fine, it worked smoothly. And I raised it to the server instead it became Forbide. Anyone know why? thank you for answering
If it is ok on local and getting a forbidden error on the server, the problem might be caused by the webserver application. please take a look at this link.

API call returns a response in postman but gives me 403 in browser

ajax call
postman url
console error
Postman returns a response, but browser gives me 403. I have attached my postman request, my ajax call as well as the browser error. Any advice is helpful
You need to pass credentials. follow this link for more information.
I ran into this issue as well. While cedric is right, the Authorization header needs to be specified, another issue can cause this as well. Postman does not include an Origin header in its requests (see: https://stackoverflow.com/a/68380707/1029688). This could cause it to ignore CORS errors that you would normally encounter when making web requests from a browser.

Endpoint Server GraphQL (overblog-GraphQLBundle) Not support Method POST

For 3 Days, my project which worked perfectly locally, once put on the production server.
GraphQl requests are a failure with the error "[Error: Network error: JSON Parse error: Unrecognized token '<']" and after log analysis it is a 404 error because the route was not found.
After investigation via the GraphQl Atlair client for chrome by changing the method to GET to make my GrasphQl requests, the error everything works.
my question is how to work the POST method?
I really need to use the METHOD POST for mutations
Thanks everyone
Very cordially
You forgot to add a trailing slash to your GraphQL endpoint URL.
Related issue (solved): https://github.com/overblog/GraphQLBundle/issues/669

Django-rest post returns get

I built out an API with django-rest, tested it on a local machine, and pushed it to my PaaS. On my local machine a view associated with a post works perfectly. The live site throws an error.
Decorator for view in question: #api_view(['POST'])
Error: u'{"detail":"Method \\"GET\\" not allowed."}'.
Python Request Module snippet (note POST not get):
r = requests.post(my_url, data=json.dumps(payload), headers=headers, verify=False)
Server log: "POST /api/xxx/xxx/ HTTP/1.1" 301
No errors in the server log, no errors in the django-rest API. The post to the function does work on the browsable API. Why am I receiving a GET error on a post? I've tried things in curl and receive the same error. What's going on?
Got it. Move from http to https wasn't reflected in the URL.

django-rest-framework: how to allow http PUT to succeed

I have a startup django-rest-framework app, which I'm using to serve data to another Django app
I have no issues with GET, POST, and DELETE, but when I issue a PUT - I get 405
What can I do to fix that?
if I'm remembering well, I has the same issue. Following the tutorial of django-rest-framework I noticed that pressing PUT botton request and monitoring network tab of chrome developer tools it did a POST request instead of PUT request.
Maybe '405 METHOD NOT ALLOWED' error message caused by request without '/' at the end of the url.
Not working 127.0.0.1:8000/article/9
Working 127.0.0.1:8000/article/9/
If not, check how you request it. It's similar to request DELETE method.
This is an example I've just testing using PAW http client application
PUT Method request screenshot
PUT Method request result screenshot

Resources