# Can't Access Private Gradio Space API Endpoint Through Postman

**URL:** <https://discuss.huggingface.co/t/cant-access-private-gradio-space-api-endpoint-through-postman/72908>\
**Category:** Spaces\
**Created:** [February 12, 2024, 11:01pm UTC](https://discuss.huggingface.co/t/cant-access-private-gradio-space-api-endpoint-through-postman/72908 "2024-02-12T23:01:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChristianOC](https://avatars.discourse-cdn.com/v4/letter/c/858c86/32.png) [@ChristianOC](https://discuss.huggingface.co/u/ChristianOC)\
**Post date:** [February 12, 2024, 11:01pm UTC](https://discuss.huggingface.co/t/cant-access-private-gradio-space-api-endpoint-through-postman/72908/1 "2024-02-12T23:01:53Z")

</div>

I am trying to access my Huggingface space through a Postman request. When I copy the exported curl command, it looks like this:

```auto
curl --location 'https://MY_SPACE_NAME_HERE.hf.space/--replicas/RANDOMDIGITS/' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer hf_REST_OF_MY_TOKEN_HERE' \
--data '{"data": ["data:image/jpeg;base64,PIC_IN_BASE64_HERE"]}'

```

But when I run this request, I get:

```auto
{
    "detail": "Method Not Allowed"
}

```

How do get this request to succeed?

Also my API endpoint works perfectly when I access it via the boilerplate python code that Gradio gives me. Do you know what the problem is?

---

<div class="post-metadata">

**Author:** ![hcr5](https://avatars.discourse-cdn.com/v4/letter/h/ee59a6/32.png) [@hcr5](https://discuss.huggingface.co/u/hcr5)\
**Post date:** [June 13, 2024, 7:03pm UTC](https://discuss.huggingface.co/t/cant-access-private-gradio-space-api-endpoint-through-postman/72908/2 "2024-06-13T19:03:22Z")

</div>

Maybe try adding `-X POST` option to the curl command, this ensures you make a post request.

```sh
curl --location 'https://MY_SPACE_NAME_HERE.hf.space/--replicas/RANDOMDIGITS/' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer hf_REST_OF_MY_TOKEN_HERE' \
--data '{"data": ["data:image/jpeg;base64,PIC_IN_BASE64_HERE"]}' \
-X POST

```
