title: Cybersource post request always getting session timeout
body: <p>I know that <strong>Cybersource</strong> isn't that much of familiar here, but I'm really stuck with something and maybe someone can help me.</p>
  <p>I've tried <strong>Cybersource Support Center</strong> but apparently they don't support testing accounts.</p>
  <p>I have the following code in which I'm trying to execute a post request to Cybersource:</p>
  <pre><code>private async void Confirm_Payment(object sender, EventArgs e)
  {
      var randomGuid = Guid.NewGuid().ToString();
      var currentDateTime = GetUTCDateTime();
      var referenceNumber = &quot;1594706148080&quot;;
  
      using (var client = new HttpClient())
      {
          using (var content = new MultipartFormDataContent())
          {
              var values = new Dictionary&lt;string, string&gt;
              {
                  {&quot;access_key&quot;, &quot;ACCESS_KEY&quot;},
                  {&quot;profile_id&quot;, &quot;PROFILE_ID&quot;},
                  {&quot;transaction_uuid&quot;, randomGuid},
                  {&quot;signed_field_names&quot;, &quot;access_key,profile_id,transaction_uuid,signed_field_names,unsigned_field_names,signed_date_time,locale,transaction_type,reference_number,amount,currency&quot;},
                  {&quot;unsigned_field_names&quot;, &quot;&quot;},
                  {&quot;signed_date_time&quot;, currentDateTime},
                  {&quot;locale&quot;, &quot;en&quot;},
                  {&quot;transaction_type&quot;, &quot;authorization&quot;},
                  {&quot;reference_number&quot;, referenceNumber},
                  {&quot;amount&quot;, &quot;100.00&quot;},
                  {&quot;currency&quot;, &quot;USD&quot;},
                  {&quot;submit&quot;, &quot;Submit&quot;}
              };
              var signature = Security.Sign(values);
              foreach (var keyValuePair in values)
              {
                  content.Add(new StringContent(keyValuePair.Value), keyValuePair.Key);
              }
  
              content.Add(new StringContent(signature), &quot;signature&quot;);
              var requestUri = &quot;https://testsecureacceptance.cybersource.com/pay&quot;;
              var result = await client.PostAsync(requestUri, content);
              if (result.IsSuccessStatusCode)
              {
                  var resp = await result.Content.ReadAsStringAsync();
                  await Navigation.PushAsync(new WebScreen(requestUri));
              }
          }
      }
  }
  </code></pre>
  <p><code>result.IsSuccessStatusCode</code> is <code>200 OK</code> but whenever I get<code>await result.Content.ReadAsStringAsync();</code> I got a <strong>Session Timeout Page</strong></p>
  <p>Note that the same code in .NET is working fine:</p>
  <pre><code>&lt;form id=&quot;payment_confirmation&quot; action=&quot;https://testsecureacceptance.cybersource.com/pay&quot; method=&quot;post&quot;&gt;
      &lt;fieldset id=&quot;confirmation&quot;&gt;
          &lt;legend&gt;Review Payment Details&lt;/legend&gt;
          &lt;div&gt;
              &lt;%
                  foreach (var key in Request.Form.AllKeys)
                  {
                      Response.Write(&quot;&lt;div&gt;&quot;);
                      Response.Write(&quot;&lt;span class=\&quot;fieldName\&quot;&gt;&quot; + key + &quot;:&lt;/span&gt;&lt;span class=\&quot;fieldValue\&quot;&gt;&quot; + Request.Params[key] + &quot;&lt;/span&gt;&quot;);
                      Response.Write(&quot;&lt;/div&gt;&quot;);
                  }
      %&gt;
          &lt;/div&gt;
      &lt;/fieldset&gt;
      &lt;%
          IDictionary&lt;string, string&gt; parameters = new Dictionary&lt;string, string&gt;();
          foreach (var key in Request.Form.AllKeys)
          {
              Response.Write(&quot;&lt;input type=\&quot;hidden\&quot; id=\&quot;&quot; + key + &quot;\&quot; name=\&quot;&quot; + key + &quot;\&quot; value=\&quot;&quot; + Request.Params[key] + &quot;\&quot;/&gt;\n&quot;);
              parameters.Add(key, Request.Params[key]);
          }
          Response.Write(&quot;&lt;input type=\&quot;hidden\&quot; id=\&quot;signature\&quot; name=\&quot;signature\&quot; value=\&quot;&quot; + secureacceptance.Security.Sign(parameters) + &quot;\&quot;/&gt;\n&quot;);
  %&gt;
      &lt;input type=&quot;submit&quot; id=&quot;submit&quot; value=&quot;Confirm&quot; /&gt;
  &lt;/form&gt;
  </code></pre>
  <p>I tried to take the same code and execute it in <code>Xamarin Forms</code> but it didn't work.</p>
  <p>I think the issue is that we should add specific Headers to let the <strong>Cybersource Gateway</strong> don't give session timeout issue. Anyone know what could be the problem?</p>