c# - Requesting Definitions Using the Wordnik API -
i've worked apis in minimal sense i've been wanting try out how time. ok have far , works returns of definition. have few questions:
- is there way request definitions without else?
- do parse data? saw in wordnik api , can include xml tags...so can use xmlreader grab definitions?
- now how requesting both definitions , if noun/verb/etc @ once?
the ultimate goal create list of definitions stuff with. appreciated. here's code far:
class program { static void main(string[] args) { string apikey = "***************"; string wordtosearch = ""; { console.write("please type word definition: "); wordtosearch = console.readline(); if (!wordtosearch.equals("q")) { string url = "http://api.wordnik.com/v4/word.json/" + wordtosearch + "/definitions?api_key=" + apikey; webrequest request = webrequest.create(url); request.method = "get"; request.contenttype = "application/json"; using (webresponse response = request.getresponse()) { using (stream stream = response.getresponsestream()) { streamreader reader = new streamreader(stream); string responsefromwordnik = reader.readtoend(); console.writeline(responsefromwordnik); } } } } while (!wordtosearch.equals("q")); } } thanks, justin
- the api documentation tell that.
- yes, parse data. if data coming down xml, can parse xmlreader, or can load xmldocument. looks you're asking json, though. if so, you'll want json parser. check out json.net.
- again, check out api documentation.
their documentation page suspiciously sparse. you'll better response on google group or 1 of other sources listed on support page.
Comments
Post a Comment