public static void Fetch_JSON_String(Virtusales.Biblio.API.Session Session) { dbg("Requesting some Data as a simple JSON string..."); Virtusales.Biblio.API.Request Req = Session.NewRequest(Page: "work-editions", Path: "default"); Req.RequestProtocol = "json"; Req.Post = "{\"id\": \"" + WorkID + "\"}"; Req.FetchString(); dbg(Req.Response); }
public static void Fetch_CSV_String(Virtusales.Biblio.API.Session Session) { dbg("Requesting some Data as a simple CSV string..."); dynamic Req = Session.NewRequest(Page: "work-editions", Path: "default"); Req.View = "csv"; Req.RequestProtocol = "text"; Req.Post = "id=" + WorkID; Req.FetchString(); dbg(Req.Response); }
public static void Fetch_Object(Virtusales.Biblio.API.Session Session) { dbg("Requesting some Data as an object..."); dynamic Req = Session.NewRequest(Page: "work-editions", Path: "default"); RequestObject ReqObject = new RequestObject(); ReqObject.id = WorkID; ReturnObject Results = Req.SendObject<RequestObject, ReturnObject>(ReqObject); dbg(Req.Response); dbg("Got " + Results.editions.Count + " editions and " + Results.products.Count + " products..."); foreach (KeyValuePair<string,Edition> kvp_loopVariable in Results.editions) { KeyValuePair<string,Edition> kvp = kvp_loopVariable; Edition edition = kvp.Value; dbg(kvp.Key + "..."); dbg(" " + edition.edition_id + " ... " + edition.edition_ean); } }