Skip to content
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

Does sql input binding support parsing of x-www-form-urlencoded form bodies? #320

Open
alpBilginCenta opened this issue Dec 12, 2024 · 0 comments

Comments

@alpBilginCenta
Copy link

Hello,

I am trying to do the following

const inputSQL = input.sql({
    commandText: 'SELECT * FROM schema.user u WHERE u.email = @email',
    commandType: 'Text',
    parameters: '@email={email}',
    connectionStringSetting: 'SqlConnectionString',
})

where the request content type is
application/x-www-form-urlencoded

and body is
email=sample%40email.com&password=supersecretpassword

As a result I get the following error

[2024-12-12T16:55:30.691Z] Executed 'Functions.belogin' (Failed, Id=96c0e3e6-4aff-4f26-b43f-22abf9944aa0, Duration=13ms)     
[2024-12-12T16:55:30.695Z] System.Private.CoreLib: Exception while executing function: Functions.belogin. Microsoft.Azure.WebJobs.Host: Error while accessing 'email': property doesn't exist.

Is there some secret sauce to parameter declaration that I haven't found, or do I have write additional code in frontend to send a JSON instead?

Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant