# POST method using HTTP request with Ray Serve

**URL:** <https://discuss.ray.io/t/post-method-using-http-request-with-ray-serve/1250>\
**Category:** Ray Serve\
**Created:** [March 12, 2021, 4:35pm UTC](https://discuss.ray.io/t/post-method-using-http-request-with-ray-serve/1250 "2021-03-12T16:35:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![aamrani-dev](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/aamrani-dev/32/624_2.png) [@aamrani-dev](https://discuss.ray.io/u/aamrani-dev)\
**Post date:** [March 12, 2021, 4:35pm UTC](https://discuss.ray.io/t/post-method-using-http-request-with-ray-serve/1250/1 "2021-03-12T16:35:21Z")

</div>

Hello guys,

I am using Ray Serve to deploy my DL models for image classification. So I want to send an image through an HTTP request to Ray Serv. I am using the curl command but I got this error

" methods post not allwoed. Available HTTP methods are [‘GET’] "

How can I fix it please!

Thanks guys 😉

---

<div class="post-metadata">

**Author:** ![architkulkarni](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/architkulkarni/32/10_2.png) [@architkulkarni](https://discuss.ray.io/u/architkulkarni)\
**Post date:** [March 16, 2021, 9:29pm UTC](https://discuss.ray.io/t/post-method-using-http-request-with-ray-serve/1250/2 "2021-03-16T21:29:38Z")

</div>

Hi @aamrani-dev, try adding `'POST'` to the `methods` parameter in `create_endpoint` for your Serve endpoint: [Serve API Reference — Ray v2.0.0.dev0](https://docs.ray.io/en/master/serve/package-ref.html#ray.serve.api.Client.create_endpoint)

---

<div class="post-metadata">

**Author:** ![aggiemaster](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/aggiemaster/32/1888_2.png) [@aggiemaster](https://discuss.ray.io/u/aggiemaster)\
**Post date:** [December 14, 2021, 1:12am UTC](https://discuss.ray.io/t/post-method-using-http-request-with-ray-serve/1250/3 "2021-12-14T01:12:51Z")

</div>

I came across this question because I was looking for the same answer. From what I can tell, create\_endpoint was deprecated in ray 1.5.0. The latest docs for 1.9.0 have ray.serve.deployment() but I do not see a setting for methods. Is there any other documentation on how to post a request body that I am missing?

---

<div class="post-metadata">

**Author:** ![simon-mo](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/simon-mo/32/9_2.png) [@simon-mo](https://discuss.ray.io/u/simon-mo)\
**Post date:** [December 15, 2021, 12:40am UTC](https://discuss.ray.io/t/post-method-using-http-request-with-ray-serve/1250/4 "2021-12-15T00:40:33Z")

</div>

Hi @aggiemaster, yes the latest way will be using fastapi [Calling Deployments via HTTP and Python — Ray v1.9.0](https://docs.ray.io/en/latest/serve/http-servehandle.html#fastapi-http-deployments) (and we will make sure not to make back-ward incompatible change going forward)

---

<div class="post-metadata">

**Author:** ![aggiemaster](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/aggiemaster/32/1888_2.png) [@aggiemaster](https://discuss.ray.io/u/aggiemaster)\
**Post date:** [December 15, 2021, 12:42am UTC](https://discuss.ray.io/t/post-method-using-http-request-with-ray-serve/1250/5 "2021-12-15T00:42:10Z")

</div>

Thanks for the reply! i’ll take a look at that documentation.

---

<div class="post-metadata">

**Author:** ![aggiemaster](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/aggiemaster/32/1888_2.png) [@aggiemaster](https://discuss.ray.io/u/aggiemaster)\
**Post date:** [December 16, 2021, 5:03pm UTC](https://discuss.ray.io/t/post-method-using-http-request-with-ray-serve/1250/6 "2021-12-16T17:03:53Z")

</div>

@simon-mo The FastAPI setup worked for me. Thanks for the help!
