Example #1
0
 /// <summary>Creates a batch response from an in-memory response representation.</summary>
 /// <param name="response">The in-memory request from which to read the response.</param>
 /// <returns>The newly created batch response.</returns>
 public static BatchWebRequest FromResponse(InMemoryWebRequest response)
 {
     BatchWebRequest batch = new BatchWebRequest();
     if (response.ResponseStatusCode != 200 && response.ResponseStatusCode != 202)
     {
         Assert.Fail("The batch response must be 200 or 202, otherwise its content will not be a batch response.");
     }
     batch.ParseBatchContent(response.GetResponseStream(), response.ResponseContentType, true, false);
     return batch;
 }
Example #2
0
        /// <summary>Creates a batch response from an in-memory response representation.</summary>
        /// <param name="response">The in-memory request from which to read the response.</param>
        /// <returns>The newly created batch response.</returns>
        public static BatchWebRequest FromResponse(InMemoryWebRequest response)
        {
            BatchWebRequest batch = new BatchWebRequest();

            if (response.ResponseStatusCode != 200 && response.ResponseStatusCode != 202)
            {
                Assert.Fail("The batch response must be 200 or 202, otherwise its content will not be a batch response.");
            }
            batch.ParseBatchContent(response.GetResponseStream(), response.ResponseContentType, true, false);
            return(batch);
        }