-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathProperty_Detail_Call.cs
More file actions
52 lines (42 loc) · 1.72 KB
/
Copy pathProperty_Detail_Call.cs
File metadata and controls
52 lines (42 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using System;
using System.Net.Http;
using System.Xml;
namespace CSHttpClientSample
{
static class Program
{
static void Main()
{
MakeApiRequest();
Console.WriteLine("Hit ENTER to exit...");
Console.ReadLine();
}
static async void MakeApiRequest()
{
var client = new HttpClient();
/////////////////////////////////////////////////////////////
///
/// MODIFY THESE INPUT VALUES TO SUITE YOUR REQUIREMENTS
///
/////////////////////////////////////////////////////////////
var apiKey = "###### your api key here ######";
var headerAccept = "application/xml";
/////////////////////////////////////////////////////////////
client.DefaultRequestHeaders.Add("apikey", apiKey);
client.DefaultRequestHeaders.Add("accept", headerAccept);
/////////////////////////////////////////////////////////////
///
/// UNCOMMENT THE LINE THAT MATCHES YOUR INPUT REUQIREMENTS
///
/////////////////////////////////////////////////////////////
var uri = @"https://search.onboard-apis.com/propertyapi/v1.0.0/property/detail?address=1731 INGRAM TER, DELTONA, FL 32725";
//var uri = @"https://search.onboard-apis.com/propertyapi/v1.0.0/property/detail?fips=12127&apn=813016030040";
string response = await client.GetStringAsync(uri);
// DISPLAY RESPONSE TO CONSOLE
Console.WriteLine(response);
// DESERIALIZE TO XML DOC FOR QUERYING
var xml = new XmlDocument();
xml.LoadXml(response);
}
}
}