Skip to content

Debugging

Tim Hall edited this page Mar 16, 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:465
  2. ExecuteAsync: RestHelpers.ExecuteRequestAsync:497
  3. Callback: RestRequest.ReadyStateChangeHandler:370
  4. Timeout, sync: RestHelpers.ExecuteRequest:472
  5. Timeout, async: RestHelpers.TimeoutTimerExpired:657 + RestRequest.TimedOut:408

Request

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

Response

  1. Response.Data: RestHelpers.CreateResponseFromHttp:530
  2. Response.Headers: RestHelpers.ExtractHeadersFromResponseHeaders:603
  3. Response.Cookies: RestHelpers.ExtractCookiesFromHeaders:570

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