The requested resource does not support http method 'GET'."

Can somebody know how to solve this error "message": "The requested resource does not support http method 'GET'."? Is there a possible way to allow the GET method on the backend? I tried adding a Cors Policy and a header to my raise fault to allow the GET method but I got the same response.

Screenshot 2022-12-12 174038.jpgScreenshot 2022-12-12 174913.jpg

0 1 5,412
1 REPLY 1

Thanks for the screenshots.  That's helpful in diagnosing. 

What I see in the trace is that your API Proxy executed successfully.  That suggests to me, strongly, that it is not a matter of CORS rejecting the request. If it were a CORS rejection, the request you are showing there would never have been executed. It is POSSIBLE that even given this evidence, there is still a problem with CORS, but it seems unlikely at this point. 

A large number of policies executed in the request flow; some of them were brought in via sharedflows. The request was sent to the upstream system.  The upstream system responded with a 405 and the error message you saw and reported. This error message does not originate from your Apigee API proxy.  

With all of that, it seems like the error message is ... accurate and clear. The upstream system doesn't support GET for the given resources. 

What is the resource?  We don't know that.  We can see from the snapshot of the Postman UI what URI you are invoking at Apigee.  But with all of the policies in the Apigee request flow, there's no way to know if one or more of them has modified the URI path that gets sent to the upstream. 

Apigee is sending a GET to the upstream.  We infer that because of the error message that the upstream is sending back.  (It's important to check this. An Apigee proxy that receives a GET request can modify the verb before invoking the upstream. So Apigee might send a POST request even though Apigee received a GET. ). OK, so Apigee is sending a GET to the upstream.  But at what path? The term "resource" in the error message is referring to the URI path of the request sent from Apigee to the upstream.  What is it? We cannot tell from the screenshots you provided. 

So check that.  In the Apigee Trace UI, if you highlight the step just before invoking the upstream, you will see the path in the request sent to the target (upstream).  THAT PATH does not support GET.  Fix that, and you should be able to avoid the error message. And by "fix that", I mean, modify your API Proxy to use a path that is supported by your upstream. 

click-here.png