Skip to content

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

Open

Description

@alpBilginCenta

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions