Updating a record in a basic collection using REST web API #4996
-
I have been searching all day but i cant seem to get past this issue, this is the first time posting so please be gentle :) I am trying to update a record (patch) using the web API and VB.NET. CurrentAdminRecord.token is valid and it how i am reading the records this is my code: Dim MyContent As HttpContent = New FormUrlEncodedContent(keyValues1) Dim response = Await client.PatchAsync(New Uri("https://xxxxxxxxx.com/api/collections/giftcards/records/" & giftrecord.id), MyContent) what am i doing wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I'm not familiar with VB.Net but you could find more details about the 400 error in the Admin UI > Logs section and/or start the executable with |
Beta Was this translation helpful? Give feedback.
On second read, it seems that you are using
FormUrlEncodedContent
which I guess will send the request asapplication/x-www-form-urlencoded
but we don't support this request content-type. The record operations works only withapplication/json
andmultipart/form-data
requests.Based on the Microsoft docs you can try with
JsonContent
orMultipartFormDataContent
.