NetTalk Central

Author Topic: Clearing MyWebClient.SetValue() Parameters for Subsequent Fetches  (Read 2798 times)

David

  • Full Member
  • ***
  • Posts: 127
    • View Profile
Using the WebClient .SetValue() I add several parameters and then fetch the URL.  How do I clear the internal list of parameters that were added with SetValue()? 

I tried:
MyWebClient.Start()


If I first run this
MyWebClient.SetValue('parm1', 'my text')
MyWebClient.Fetch('http://someurl')

Then after the PageReceived I run this
MyWebClient.Start()
MyWebClient.SetAllHeadersDefault()
MyWebClient.Fetch('http://someotherurl')

I can see in the logs that parm1 was added to the fetched URL.  I can probably solve this with MyWebClient.DeleteValue('Parm1') but was wondering then what .Start() was for.  And if I do a .Start() do I still need to do .SetAllHeadersDefault()?

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11171
    • View Profile
Re: Clearing MyWebClient.SetValue() Parameters for Subsequent Fetches
« Reply #1 on: January 10, 2019, 09:55:15 PM »
MyWebClient.FreeFieldsQueue()

This should be in .Start (I've added that for 11.05)

cheers
Bruce

David

  • Full Member
  • ***
  • Posts: 127
    • View Profile
Re: Clearing MyWebClient.SetValue() Parameters for Subsequent Fetches
« Reply #2 on: January 11, 2019, 11:15:59 AM »
Thank you.

Does .Start() also include .SetAllHeadersDefault() ?

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11171
    • View Profile
Re: Clearing MyWebClient.SetValue() Parameters for Subsequent Fetches
« Reply #3 on: January 14, 2019, 01:35:49 AM »
In the spirit of "teach a man to fish" - the NetWebClient code is in netwww.clw.....
It's derived from NetWebHttp class which is in nethttp.clw
Cheers
Bruce