Is Requesting multipart form data supported in ASD via invoke external end point procedure?

Ayush Shrivastava 120 Reputation points
2024-08-06T15:06:36.5266667+00:00

I am replication a java rest call that I was already making in my application but now I want to call the same API using sp_invoke_external_rest_endpoint.

My java code

byte[] metadataBytes = objectMapper.writeValueAsBytes(metadata);

FormDataBodyPart metadataPart = new FormDataBodyPart("metadata",new ByteArrayInputStream(metadataBytes), MediaType.APPLICATION_JSON_TYPE);
form.bodyPart(metadataPart);

I want the same thing in T-SQL.

Assuming - I have my

DECLARE @json_body VARCHAR(MAX) -- This is equals to the metadata in the above java code.

And I am converting to byte array like this - DECLARE @byteArray VARBINARY(MAX);

Can someone help me here.

Thanks

Azure SQL Database
{count} votes

1 answer

Sort by: Most helpful
  1. SSingh-MSFT 16,371 Reputation points Moderator
    2024-08-13T04:02:15.5333333+00:00

    Hi Ayush Shrivastava,

    Thanks for your patience.

    Reply from the internal team is as followed:

    No, we don't support multi-form data with the invoke REST API endpoint proc. We only support x-www-form-urlencoded.

    However, if you want this feature to be added to Azure SQL Database, please raise an idea on Feedback Channel Azure SQL DB:

    https://feedback.azure.com/d365community/forum/ef2b2b38-2f25-ec11-b6e6-000d3a4f0f84

    Team will take up depending upon the importance and up-votes.

    Thanks

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.