Created
February 13, 2020 09:09
-
-
Save smetronic/6fa8d0bbfa09ebcfc535d41dc7dbc681 to your computer and use it in GitHub Desktop.
C# REST Client, HttpWebRequest
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var vm = new { label = item.PlateNo, asset = item.AssetCode, rfid = "12345678" }; | |
using (var client = new WebClient()) | |
{ | |
var dataString = JsonConvert.SerializeObject(vm); | |
client.Headers.Add(HttpRequestHeader.ContentType, "application/json"); | |
// client.Headers.Add(HttpRequestHeader.Accept, "application/json"); | |
var res = client.UploadString(new Uri($"http://xx.xx.xx.xx/casper/api/FCS/SecondaryTag?key={key}"), "POST", dataString); | |
if (res == "1") | |
{ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment