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:

  1. is there way request definitions without else?
  2. do parse data? saw in wordnik api , can include xml tags...so can use xmlreader grab definitions?
  3. 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

  1. the api documentation tell that.
  2. 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.
  3. 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

Popular posts from this blog

matlab - Deleting rows with specific rules -

jquery - How would i go about shortening this code? And to cancel the previous click on click of new section? -