# No error message but empty response body when querying vectors using the API in C#

**URL:** <https://community.pinecone.io/t/no-error-message-but-empty-response-body-when-querying-vectors-using-the-api-in-c/2844>\
**Category:** Support\
**Created:** [July 30, 2023, 5:41pm UTC](https://community.pinecone.io/t/no-error-message-but-empty-response-body-when-querying-vectors-using-the-api-in-c/2844 "2023-07-30T17:41:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![epteak](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/epteak/32/775_2.png) [@epteak](https://community.pinecone.io/u/epteak)\
**Post date:** [July 30, 2023, 5:41pm UTC](https://community.pinecone.io/t/no-error-message-but-empty-response-body-when-querying-vectors-using-the-api-in-c/2844/1 "2023-07-30T17:41:55Z")

</div>

Hello, I’m using C# and the API to upsert and query vectors. I’ve managed to sucessfully upsert vectors to the index however I can’t query them even though I get a successful response from the server as shown here :

```auto
StatusCode: 200, ReasonPhrase: 'OK', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
grpc-status: 12
date: Sun, 30 Jul 2023 17:21:08 GMT
server: envoy
connection: close
content-length: 0
}

```

Here is the code I’m using to query the vectors :

```auto
public async void QueryVectors(string vector)
        {
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("Query URL of my index"),
                Headers =
                {
                    { "accept", "application/json" },
                    { "Api-Key", "My API key" },
                },
                Content = new StringContent("{\"namespace\":\"default-namespace\",\"topK\":1,\"includeValues\":\"false\",\"includeMetadata\":\"true\",\"vector\":\"" + "[" + vector + "]" + "}", Encoding.UTF8, "application/json")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Debug.Log(body);
            }
        }

```

The code returns an empty body, any suggestions ?

---

<div class="post-metadata">

**Author:** ![dra](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/dra/32/171_2.png) [@dra](https://community.pinecone.io/u/dra)\
**Post date:** [July 31, 2023, 1:28pm UTC](https://community.pinecone.io/t/no-error-message-but-empty-response-body-when-querying-vectors-using-the-api-in-c/2844/2 "2023-07-31T13:28:12Z")

</div>

Hi, @epteak

Firstly, looking at your response headers, there’s an error code ‘grpc-status: 12’. This is a gRPC error code, which stands for ‘UNIMPLEMENTED’. It means that the server understands the request, but it’s not capable of fulfilling it because the functionality isn’t implemented.

Secondly, looking at your query code, it seems like there might be an issue with how you’re representing the vector in your request body. Vectors are typically represented as arrays of numbers, but in your code, it seems like you’re treating the vector as a string. This could be causing the issue.

To correctly represent the vector, you should treat the vector as an array of numbers, not a string. Like so:

csharpCopy code

```auto
Content = new StringContent("{\"namespace\":\"default-namespace\",\"topK\":1,\"includeValues\":\"false\",\"includeMetadata\":\"true\",\"vector\":" + vector + "}", Encoding.UTF8, "application/json")

```

Here, `vector` should be a JSON string representing an array of numbers, like `"[1.0, 2.0, 3.0]"`.

Another possibility that comes to mind is that the URL might not be correct.

- When the path following Pinecone’s service domain (.svc.us-east1-gcp.pinecone.io) is not valid, an HTTP 200 OK with an empty Body appears to be returned. (This assumes that the Api-Key is correctly set). In this case, even if the value of the POST Body is an invalid string (text/plain), an HTTP 200 is still returned.
- If the URL is correct and there is a problem with the Body, HTTP 400 should be returned.
- You mentioned that the index update was successful, but can you confirm that the vectors have been added on the following screen as well?  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/pinecone/original/2X/3/39259814509433c9a16c5a64a07a797e9aaa0a4e.png)

---

<div class="post-metadata">

**Author:** ![neon-sunset](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/neon-sunset/32/553_2.png) [@neon-sunset](https://community.pinecone.io/u/neon-sunset)\
**Post date:** [August 2, 2023, 1:24pm UTC](https://community.pinecone.io/t/no-error-message-but-empty-response-body-when-querying-vectors-using-the-api-in-c/2844/3 "2023-08-02T13:24:11Z")

</div>

@epteak If you’re interested, you can give [Pinecone.NET](https://github.com/neon-sunset/Pinecone.NET) a try, unless your TFM is below net7.0 or you require a different/custom behavior.

---

<div class="post-metadata">

**Author:** ![epteak](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/epteak/32/775_2.png) [@epteak](https://community.pinecone.io/u/epteak)\
**Post date:** [August 12, 2023, 6:51pm UTC](https://community.pinecone.io/t/no-error-message-but-empty-response-body-when-querying-vectors-using-the-api-in-c/2844/4 "2023-08-12T18:51:39Z")

</div>

Hello @dra  
Thank you very much for your answer since it allowed me to fix the problem.  
The issue was indeed related to the path following Pinecone’s service domain. The path was https://“my index name”.svc.eu-west1-gcp.pinecone.io/vectors/query instead of https://“my index name”.svc.eu-west1-gcp.pinecone.io/query
