Simon Mourier's Avatar
Simon Mourier's blog (1807 answers on StackOverflow) about Microsoft technologies C#, C/C++, .NET, WinRT, WinUI3, AOT, P/Invoke, COM, Interop, DirectX, Direct2D, Windows, ...
  • 🔎︎ Search
  • Categories
  • Archives
  • About Me
  • c#
  • outlook

getting this error: "The remote server returned an error: (422) Unprocessable Entity." when doing post from C# to RoR

Jan 30, 2011 See the question and my original answer on StackOverflow

POST data must be encoded prior to be sent out on the wire as ASCII, if you are sending character not in the ASCII range. You should try something like:

Byte[] postData = asciiEncoding.GetBytes(HttpUtility.UrlEncode("email=e2@email.com&password=hunter2"));
  • SmoBlog © 2010-2026 Simon Mourier. All rights reserved.
  • Privacy & Terms