This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
========================================================== | |
GET http://birch:1001/ HTTP/1.1 | |
User-Agent: Fiddler | |
Host: birch:1001 | |
GET http://birch:1001/speakers HTTP/1.1 | |
User-Agent: Fiddler | |
Host: birch:1001 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<tmds:DataSource> | |
<tmds:HttpRequest url="/desktop/{dataset}/documents/quote/{id}"> | |
</tmds:HttpRequest> | |
</tmds:DataSource> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Fact] | |
public void HttpMessageContent_from_a_file() | |
{ | |
var stream = | |
this.GetType().Assembly.GetManifestResourceStream("ClientSamples.StaticContent.HttpResponseMessage.txt"); | |
var content = new StreamContent(stream); | |
var contentType = new MediaTypeHeaderValue("application/http"); | |
contentType.Parameters.Add(new NameValueHeaderValue("msgtype", "response")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void TestBigDownload(string host) | |
{ | |
var httpclient = new HttpClient() { BaseAddress = new Uri(host) }; | |
var stream = httpclient.GetStreamAsync("pullbigresource").Result; | |
var bytes = new byte[10000]; | |
var bytesread = stream.Read(bytes, 0, 1000); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static async Task TestNoCache(string host) | |
{ | |
var clientHandler = new WebRequestHandler(); | |
clientHandler.CachePolicy = new RequestCachePolicy(RequestCacheLevel.Default); | |
var client = new HttpClient(clientHandler) { BaseAddress = new Uri(host) }; | |
var response = await client.GetAsync("/CacheableResource"); | |
var request = new HttpRequestMessage() | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Server Software: Microsoft-HTTPAPI/2.0 | |
Server Hostname: OAK | |
Server Port: 1001 | |
Document Path: /CacheableResource | |
Document Length: 22 bytes | |
Concurrency Level: 1000 | |
Time taken for tests: 4.499 seconds | |
Complete requests: 60000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GET http://finance.services.appex.bing.com/Market.svc/AppTileV2?symbols=127.10.0000&contentType=0&tileType=0&locale=en-ca&symbolTypes= HTTP/1.1 | |
User-Agent: Microsoft-WNS/6.3 | |
Host: finance.services.appex.bing.com | |
Pragma: no-cache | |
=> | |
HTTP/1.1 200 OK | |
Content-Length: 1126 | |
Content-Type: application/xml; charset=utf-8 | |
Last-Modified: Fri, 10 Jan 2014 21:51:25 GMT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Net.Http; | |
using System.Net.Http.Headers; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Salesforce.Common.Models; | |
using Newtonsoft.Json; | |
using Newtonsoft.Json.Linq; | |
namespace Salesforce.Common |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var server = WebApp.Start("http://localhost:1002/", (app) => | |
{ | |
var config = new HttpConfiguration(); | |
config.MapHttpAttributeRoutes(); | |
config.Services.Replace(typeof(IExceptionHandler), new RethrowExceptionHandler()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
ServicePointManager.DefaultConnectionLimit = 2; | |
var tasks = new Task[10]; | |
for (int i = 0; i < 10; i++) | |
{ | |
tasks[i] = Run(); |