In VBA, I used this query string to send variables to the API and save it to the database. Is possible to do the same in C#? and how are the variables marked in the query string and send it with HttpClient?
VBA Query String :
sDataPairs = "mail_from=" & strFrom & "&mail_to=" & strTo & "&url_attribute=" & strWebLink
for example: "mail_from is the name of the column in the database, strFrom is a variable from outlook active current item.
VBA result:
https://my.address.com/api?=mail_from=strFrom&mail_to=strTo&url_attribute=strWebLink
mail_fromto the end.+to concatenate strings, but as the VBA results shows, this can produce invalid results. There are classes in both .NET and .NET Core that allow you to generate a query string from a list of key/value pairs that take care of properly encoding keys and values. In .NET Core, it's WebUtilities.QueryHelpers. TheUriclass can be used to represent URIs while UriBuilder builds them