Skip to content

Invoking RPC results in exception 'No API key found in request' #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
orhanmaden opened this issue Nov 22, 2022 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@orhanmaden
Copy link

orhanmaden commented Nov 22, 2022

Bug report

Describe the bug

Exception is thrown when using invoking RPC call.

To Reproduce

  1. Create procedure via supabase SQL Editor
CREATE OR REPLACE FUNCTION test(
	inputText text) RETURNS text AS
$$
	SELECT inputText;
$$ LANGUAGE 'sql';
  1. Run supabase-csharp
const string URL = "";
const string KEY = "";
var client = new Supabase.Client(URL, KEY, new Supabase.SupabaseOptions { AutoConnectRealtime = true, });
await client.InitializeAsync();

var dict = new Dictionary<string, object>();
dict.Add("inputText ", "Hello World!");

var response = await client.Rpc("public.test", dict);
  1. See the exception
Postgrest.RequestException: No API key found in request
   at Postgrest.Helpers.MakeRequest(ClientOptions clientOptions, HttpMethod method, String url, JsonSerializerSettings serializerSettings, Object data, Dictionary`2 headers, CancellationToken cancellationToken)
   at UserQuery.Main() in C:\path\to\file:line 10

Expected behavior

Invoke RPC call successful.

Screenshots

N/A

System information

  • OS: Windows
  • Version of supabase-charp: 0.6.1

Additional context

N/A

@orhanmaden orhanmaden added the bug Something isn't working label Nov 22, 2022
acupofjose added a commit to supabase-community/postgrest-csharp that referenced this issue Nov 22, 2022
@acupofjose
Copy link
Contributor

@orhanmaden thanks for the bug report! The fix is available in v0.6.2. Unfortunately the change to a dynamic GetHeaders function in the v0.6.0 wasn't propagated to the Rpc calls.

Let me know if you have any more issues!

Joseph

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants