3
나는 다음과 같은 GET 요청이 : 이것은 JSON의 예입니다읽기 JSON 개체를 찾아 값이
string url = @"http://api.flexianalysis.com/services/flexianalysisservice.svc/TechnicalAnalysisByCategory?clientid=___&category=forex&key=____";
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.AutomaticDecompression = DecompressionMethods.GZip;
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
using (Stream stream = response.GetResponseStream())
using (StreamReader reader = new StreamReader(stream))
{
rawJson = new StreamReader(response.GetResponseStream()).ReadToEnd();
//html = reader.ReadToEnd();
}
: 다음
[{"ID":133739,"TickerID":23,"CategoryID":3,"ClientID":5044,"TickerDateTime":"2017-11-06T12:57:19.267","TickerTitle":"AUD/USD Intraday: key resistance at 0.7670.\r\n","Category":"Forex","TradePairName":"AUD/USD","Ticker":"AUD","TrendType":"THE upside prevails","Status":"Enabled","TrendValue1":"+1","PivotValue":0.767,"OurPreference":"v: short positions below 0.7670 with targets at 0.7635 & 0.7615 in extension.\r\n","AlternateScenario":"o: above 0.7670 look for further upside with 0.7695 & 0.7715 as targets.\r\n","Comments":" as long as 0.7670 is resistance, look for choppy price action with a bearish bias.\r\n","S1":0.7635,"S2":0.7615,"S3":0.7595,"R1":0.767,"R2":0.7695,"R3":0.7715,"Entry":0.0,"Stop":0.0,"T1":0.0,"T2":0.0},{"ID":133738,"TickerID":193,"CategoryID":3,"ClientID":5044,"TickerDateTime":"2017-11-06T12:55:54.33","TickerTitle":"Dollar Index (ICE) Intraday: bullish bias above 94.8000.\r\n","Category":"Forex","TradePairName":"Dollar Index (ICE)","Ticker":"DXA","TrendType":"THE upside prevails","Status":"Enabled","TrendValue1":"+1""PivotValue":94.8,"OurPreference":": long positions above 94.8000 with targets at 95.1500 & 95.3000 in extension.\r\n","AlternateScenario":"below 94.8000 look for further downside with 94.6500 & 94.4500 as targets.\r\n","Comments":": the RSI lacks downward momentum.","S1":94.8,"S2":94.65,"S3":94.45,"R1":95.15,"R2":95.3,"R3":95.45,"Entry":0.0,"Stop":0.0,"T1":0.0,"T2":0.0}]
내가 JSON로 구문 분석하려고하고
var json = JObject.Parse(rawJson);
var filter = json["d"];
var fff = filter["ID"];//Get the error here
지금 내가 ID를 읽을 수 있지만, 어떤 이유로 그것은 자식 노드에 액세스 할 수 없다는 오류를 제공합니다 : 시작 부분에 'D'를 제거합니다. 그 이유는 무엇입니까?
오류 및 정확한 오류 메시지를받을 수 있나요 어떤 줄을 설명해주십시오. – Steve
'key'와'clientId' 요청은 비공개로 사용하고 있습니까? 그렇다면, 수정 내역을 편집 기록에 남겨주세요. – Icepickle
@Icepickle 이미 신고 됨;) –