title: Blank values received when using RestSharp from Console Application
body: <p>I've created a C# console application that calls a stored procedure from SQL Server, retrieves records from a database table where records have not been transmitted, and adds said records to a RestSharp request.  When I run my application locally, OK Status is received with a Status Code reflecting missing information.  The API's logging system shows empty values in the received request.  </p>
  
  <p>I've tried the RestSharp request as follows:</p>
  
  <pre><code>private static RestRequest CreateRestRequest(string resource, Method method)
      {
  
          var credentials = GetCredentials();
  
          var restRequest = new RestRequest { Resource = resource, Method = method, RequestFormat = DataFormat.Json, };
          restRequest.AddHeader("accept", "application/json");
          restRequest.AddHeader("Authorization", credentials);
          restRequest.OnBeforeDeserialization = resp =&gt; { resp.ContentType = "application/json"; };
          restRequest.OnBeforeDeserialization = resp =&gt; { resp.ContentEncoding = "utf-8"; };
          restRequest.OnBeforeDeserialization = resp =&gt;
          {
              if (resp.RawBytes.Length &gt;= 3 &amp;&amp; resp.RawBytes[0] == 0xEF &amp;&amp; resp.RawBytes[1] == 0xBB &amp;&amp; resp.RawBytes[2] == 0xBF)
              {
                  // Copy the data but with the UTF-8 BOM removed.
                  var newData = new byte[resp.RawBytes.Length - 3];
                  Buffer.BlockCopy(resp.RawBytes, 3, newData, 0, newData.Length);
                  resp.RawBytes = newData;
  
                  // Force re-conversion to string on next access
                  resp.Content = null;
              }
          };
          Console.WriteLine(restRequest);
          return restRequest;
      }
  </code></pre>
  
  <p>The logic used for the request values is as follows:</p>
  
  <pre><code>private SignUpRequest BuildMerchantTestData()
      {
          var onboardingDAL = new OnboardingDAL(iconfiguration);
  
          var onboardingList = onboardingDAL.GetOnboardingList(iconfiguration);
          var ownerList  = new List&lt;OwnerList&gt;();
  
  
          if (onboardingList != null)
          {
              Debug.Assert(onboardingList != null, nameof(OnboardingList) + " != null");
              foreach (Onboarding result in onboardingList)
              {
                  Console.WriteLine("{0} {1}", result.Email, result.UserId);
                  List&lt;Owner&gt; owner1 = new List&lt;Owner&gt;{ new Owner
                  {
                      FirstName = result.OwnerFirstName,
                      LastName = result.OwnerLastName,
                      Address = result.OwnerAddress,
                      City = result.OwnerCity,
                      State = result.OwnerRegion,
                      Zip = result.OwnerZipCode,
                      Country =result.OwnerCountry,
                      DateOfBirth = result.OwnerDob,
                      SSN = result.OwnerSsn,
                      Email = result.Email,
                      Percentage = result.OwnerPercentage,
                      Title = result.OwnerTitle
                  }};
                  var signupRequest = new SignUpRequest
                  {
                      PersonalData = new PersonalData
                      {
                          FirstName = result.FirstName,
                          MiddleInitial = result.MiddleInitial,
                          LastName = result.Lastname,
                          DateOfBirth = result.DateOfBirth,
                          SocialSecurityNumber = result.Ssn,
                          SourceEmail = result.Email,
                          PhoneInformation =
                              new PhoneInformation
                                  {DayPhone = result.DayPhone, EveningPhone = result.EveningPhone},
  
                      },
                      InternationalSignUpData = null,
  
                      NotificationEmail = result.Email,
                      SignupAccountData = new SignupAccountData
                      {
                          CurrencyCode = "USD",
                          Tier = "Test"
                      },
                      BusinessData =
                          new BusinessData
                          {
                              BusinessLegalName = result.BusinessLegalName,
                              DoingBusinessAs = result.DoingBusinessAs,
                              EIN = result.Ein,
                              MerchantCategoryCode = result.MerchantCategoryCode,
                              WebsiteURL = result.BusinessUrl,
                              BusinessDescription = result.BusinessDescription,
                              MonthlyBankCardVolume = result.MonthlyBankCardVolume ?? 0,
                              AverageTicket = result.AverageTicket ?? 0,
                              HighestTicket = result.HighestTicket ?? 0
                          },
                      Address = new Address
                      {
                          ApartmentNumber = result.Address1ApartmentNumber,
                          Address1 = result.Address1Line1,
                          Address2 = result.Address1Line1,
                          City = result.Address1City,
                          State = result.Address1State,
                          Country = result.Address1Country,
                          Zip = result.Address1ZipCode
                      },
                      MailAddress = new Address
                      {
                          ApartmentNumber = result.OwnerApartmentNumber,
                          Address1 = result.OwnerAddress,
                          Address2 = result.OwnerAddress2,
                          City = result.OwnerCity,
                          State = result.OwnerRegion,
                          Country = result.OwnerCountry,
                          Zip = result.OwnerZipCode
                      },
                      BusinessAddress =
                          new Address
                          {
                              ApartmentNumber = result.BusinessApartmentNumber,
                              Address1 = result.BusinessAddressLine1,
                              Address2 = result.BusinessAddressLine2,
                              City = result.BusinessCity,
                              State = result.BusinessState,
                              Country = result.BusinessCountry,
                              Zip = result.BusinessZipCode
                          },
                      BankAccount =
                          new BankAccount
                          {
                              AccountCountryCode = result.BankAccount1CountryCode,
                              BankAccountNumber = result.BankAccount1Number,
                              RoutingNumber = result.BankAccount1RoutingNumber,
                              AccountOwnershipType = result.BankAccount1OwnershipType,
                              BankName = result.BankAccount1BankName,
                              AccountType = "Checking",
                              AccountName = result.BankAccount1Name,
                              Description = result.BankAccount1Description
                          },
                      BeneficialOwnerData = new BeneficialOwnerData
                      {
                          OwnerCount = "1",
                          Owners = owner1
                      }
                  };                    Console.WriteLine(JsonConvert.SerializeObject(signupRequest));
  
              }
          }
          return new SignUpRequest();
      }
  </code></pre>
  
  <p>I'm executing the request as follows:</p>
  
  <pre><code>private static T Execute&lt;T&gt;(IRestRequest request, string baseUrl) where T : class, new()
      {
  
          var client = new RestClient(baseUrl);
          var response = client.Execute&lt;T&gt;(request);
  
          if (response.ErrorException != null)
          {
              Console.WriteLine(
                  "Error: Exception: {0}, Message: {1}, Headers: {2}, Content: {3}, Status Code: {4}",
                  response.ErrorException,
                  response.ErrorMessage,
                  response.Headers,
                  response.Content,
                  response.StatusCode);
          }
  
          Console.WriteLine("Status:" + response.StatusCode);
          Console.WriteLine("Message: " + response.Content);
          Console.WriteLine(response.Data);
          return response.Data;
      }
  
      public ProPayResponse MerchantSignUpForProPay()
      {
          var baseUrl = "https://xmltestapi.propay.com/ProPayAPI";
          var request = BuildMerchantTestData();
          var restRequest = CreateRestRequest("SignUp", Method.PUT);
          restRequest.AddJsonBody(request);
          _context?.SaveChangesAsync();
          return Execute&lt;ProPayResponse&gt;(restRequest, baseUrl);
  
      }
  </code></pre>
  
  <p>Why would the JSON string contain valid values in my console, but yet no values are received by the API?  How would I rectify this issue?</p>