Beispiel #1
0
        public async Task JsonRestClient_WorksAsync()
        {
            var client = new JsonRestClient(Server, AccessToken);

            var request = new JsonGetRequest <Instruments>("instruments?accountId=" + 6184634 + "&instruments=" + Uri.EscapeDataString("EUR_USD,USD_CAD"));

            var result = await client.Get <Instruments>(request);
        }
    async void Start()
    {
        try {
            var jsonClient = new JsonRestClient(this);
            var url        = isLocal ? "http://*****:*****@" + response.IpAddress + " on:" + response.Port);
            client.StartNetworked(response.Port, response.IpAddress, response.PlayerSessionId, this, settings);
        } catch (Exception e) {
            Debug.LogError("failed to start");
            Debug.LogError(e);
        }
    }
        public void WhenPerformingGetRequestThenSetsAcceptHeader()
        {
            _jsonClient.Get(new Uri("http://localhost?$orderby=Value"));

            _mockRequest.Object.Headers[HttpRequestHeader.Accept] = JsonHeader;
        }