Skip to content

Debugging

Tim Hall edited this page Mar 17, 2014 · 3 revisions

Debugging Excel-REST can be difficult due to the complexity of the library, but I have found the following tips helpful for setting breakpoints to get an idea of what's occurring under the surface:

(Note: line numbers may change as the library changes)

General

  1. Execute: RestHelpers.ExecuteRequest:461
  2. ExecuteAsync: RestHelpers.ExecuteRequestAsync:495
  3. Callback: RestRequest.ReadyStateChangeHandler:370
  4. Timeout, sync: RestHelpers.ExecuteRequest:473
  5. Timeout, async: RestHelpers.TimeoutTimerExpired:689 + RestRequest.TimedOut:408

Request

  1. Request.Url, without Authenticator: RestClient.HttpSetup:132 + RestRequest.FormattedResource:104
  2. Request.Body, sync: RestHelpers.ExecuteRequest:466 + RestRequest.Body:141
  3. Request.Body, async: RestHelpers.ExecuteRequestAsync:503 + RestRequest.Body:141
  4. Request.Headers: RestHelpers.SetHeaders:422
  5. Request.Cookies: RestHelpers.SetHeaders:427
  6. Request.Proxy: RestHelpers.PrepareProxyForHttpRequest:441

Response

  1. Response.Data: RestHelpers.CreateResponseFromHttp:531
  2. Response.Headers: RestHelpers.ExtractHeadersFromResponseHeaders:599
  3. Response.Cookies: RestHelpers.ExtractCookiesFromHeaders:564

Tips

  1. Determining what's stored in Headers, Parameters, Segments, Cookies, Body, and other dictionaries: Set breakpoint at issue, open Immediate Window (Ctrl + g), and use the following: ? RestHelpers.ConvertToJSON(...Dictionary...) (? is short for Debug.Print). For example to view the Headers saved for YourRequest, use: ? RestHelpers.ConvertToJSON(YourRequest.Headers)
Clone this wiki locally