Hi, I am trying to call the Pinecone API in my Flutter app with:
final headers = {
'Api-Key': apiKey,
'accept': 'application/json',
'content-type': 'application/json',
};
final requestBody = jsonEncode({
'includeValues': false,
'includeMetadata': true,
'vector': encodedText,
'topK': 10,
'namespace': category,
});
try {
final response = await http.post(
Uri.parse(pineconeUrl),
headers: headers,
body: requestBody,
);
I run into the issue where I get Dart/Flutter: Http request raises XMLHttpRequest error whenever I try to call the API in my release build. It works fine in my debug build. I’ve read it may be related to CORS, but after reading your doc I am not doing any localhost.