Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created July 2, 2021 15:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjoerntx/2ddbadeaa036c42db125c62a19b62340 to your computer and use it in GitHub Desktop.
Save bjoerntx/2ddbadeaa036c42db125c62a19b62340 to your computer and use it in GitHub Desktop.
[HttpPost]
public IActionResult FormValues(string Username) {
// read stream to retrieve form field values
Stream inputStream = Request.Body;
FormField[] fields;
StreamReader str = new StreamReader(inputStream);
string sBuf = str.ReadToEndAsync().Result;
fields = (FormField[])JsonConvert.DeserializeObject(sBuf, typeof(FormField[]));
// write the values
DeploymentHelpers.WriteValue(Username, fields);
return Ok();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment