I am trying to make a webhook that get triggered by ATrigger. I tried it but every time it shows error 405, method not allowed.
It works when doing a POST through the server, or through Hurl.it
ATrigger doesn't use POST, it uses GET
Related
I configured a REST API in API gateway. It calls a lambda function to return rows. When I tested the API in the AWS console, it works fine. When invoked from the app it throws the following error.
I copied the request as cURL command from the browser and tested from postman, and I see the response in postman. Not sure what I am missing.
Be careful about taking this error too literally. What often happens is that there is a underlying error in the API and it responded with an error message only, and thereby did not send any course headers. So it's not really a course header issue but instead some other error. Check with curl directly and see what's responding with.
I've been trying to try to do this for a couple of days for now. I am trying to update the user's data through put method in Django using rest framework. However, I've been receiving this error message in the console.
This is the fetch function that is used to send the data to the backend. As it's shown, I'm even trying to compare it to other fetch methods and I think nothing is wrong with the body of the fetch.
Below are my codes used to update the data.
views.py
serializers.py
urls.py
So, the error is
Unexpected token < in JSON
which means that it tried to parse a response containing a character <. If I had to guess, the response is a HTML document, because it would start with < (<html>...).
For instance, it can be a 404 error page because the URL was not found. The best way to know is, instead of logging response.json(), just log response.text(). Until you do that, hard to know what really happens.
I have a django app built with graphene and I have a problem running a simple POST query for the GraphQL endpoint, it keeps returning a 400 Bad request syntax.
but it should work since I don't have any problems running the query from the endpoint http://localhost:8000/graphql-dev
and I can't see any issues in the way I send the postman request.
I looked online for suitable solutions but couldn't find any that would help.
Any help/tips would be greatly appreciated.
EDIT:
I still didn't manage to see why I'm having this issue with postman, but here are some observations:
first, i changed the request to GET (since in graphql, query is for GET and mutation for POST - sorry, I missed that)
I tried the same request with postman (which didn't work) and with insomnia (which did)
with postman
with insomnia
What's weird is that if i check my django console the requests look the same.
EDIT2: okay, I figured it out...removing the Content-Type application/json did the trick. Now it works with postman as well.
I have the following API downloaded in JSON from Swagger Editor:
PUT http://10.37.64.243/m2m/fim/items/fim:device:manager/operations/getAllDeviceTypes?exclude={{exclude}}
with exclude being an environment variable set as : href,metadata,name,arguments
Nominal use requires basic authentication, in this case it works and I get a JSON body with expected result. It properly works in Postman (so I think my import is correct)
If no authentication is provided:
in Swagger Editor : nominal behaviour, request is rejected with error code 401
in Postman : UNEXPECTED behaviour, I end up with status code 200 and it returns a response body identical to the one that I get when authenticated
if I generate the cURL code snippet from Postman and launch it out of Postman: nominal behaviour, I get the same error as the one I get in Swagger Editor (the one expected)
Why do Postman behave differently from the cURL request ??
I probably do something wrong, but I can't figure out what
Thanks for any help
Alexandre
I finally found out that the server returns a cookie that holds authentication validation. So after a valid authentication, whatever the request (with or without authentication) it will be considered as authentified.
Unfortunately, the only way to overcome that problem is to remove the cookie by hand through the "Manage cookies" window. Postman does not implement a function that erase it (even through the pm.cookies and pm.cookies.clear() function).
Postman developpers are aware of that, but there's no scheduling for this feature ...
EDIT: the feature is followed here https://github.com/postmanlabs/postman-app-support/issues/3312
Did Google recently change the return code sent to clients when the delete member call is invoked with a memberKey parameter that does not represent a current member of the group from 404 Not Found to 400 Bad Request?
I tested using the Admin SDK Explorer found at this page: https://developers.google.com/admin-sdk/directory/v1/reference/members/delete . I used the group's email address as the groupKey and a user's (non-member) email address as the memberKey.
If so what is the best way for developers to become aware of such changes?
Scouring the Admin SDK reference returned no results for error/response code definitions. This is a serious missing feature of the documentation. I'm unsure how Google expects developer to handle errors when we can't know what the errors will be.
That said, I receive a 404 Not Found when invoking a groups.list call with an invalid memberKey. A 400 Bad Request sounds like the structure of the call is at fault based on a description of that error code for the Analystics API. Could you post the code for your API call?
In response to your edit: It appears that the delete member call expects a user that is a current member of the groupKey group. If you are getting the same result (400 Bad Request) using the SDK Explorer then I guess that means the response code changed. If the Explorer gives you a 404 Not Found response, then it is likely a syntax error in your request code.