Method Not Allowed Error Hosted API

When I try to connect to my trained models API in order to use it on visual studio code, I get an error which in summary says HTTPError: 405 Client Error: Method Not Allowed for URL:

I get this error even though I filled my API key, MODEL_ENDPOINT and version correctly, by double-checking from the “Use curl command” section.

1 Like

answered your question on your other post, here: Error occuring while trying the API - #2 by Mohamed

I’m having the exact same issue of the 405. Using a workflow same as here

https://blog.roboflow.com/python-webcam/

Hi @James_Vance

The model endpoint details have changed a bit since that post was published. For the most up-to-date details, check out our documentation, especially for the object detection hosted API.

One notable difference from the quick look I took at the blog post was that we no longer use the param access_token and we instead use api_key.

Let us know if you still have trouble solving your issue!

Thanks @leo the reason for the 405 was I wasn’t including the model number version like https://detect.roboflow.com/csv-to-txt-mutvh?api_key= instead of https://detect.roboflow.com/csv-to-txt-mutvh/1?api_key=.

Now, when I load the response as a bytearray (below)

image = np.asarray(bytearray(resp.raw.read()), dtype="uint8")

it all comes back in a 1D numpy array with length 7500. Do you know if there’s a reshape necessary of it this is model dependent? When running the model locally, it returns a structured text with the bounds, keypoints, etc

Hi @James_Vance

Could you provide the exact code and/or URL that you are requesting the API with? I don’t believe it should come back as a numpy array. It’d also be helpful to see examples of the array and the structured text you mentioned.