Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

I POST to website's JSON-response URL using WebBrowser.Navigate().

All goes well, including the webBrowser1_DocumentCompleted() event handler being called.

But instead of getting a "quiet" response (e.g. webBrowser1.Document) that I can handle programmatically, I receive a File Download dialog box:

enter image description here

If I click the Save button and later examine the file, it contains exactly the JSON response that I expect.

But I want the program capture this JSON response in-code, without displaying that dialog and having to click the Save button.

How do I capture JSON response using WebBrowser control?

Note: before posting this question I searched SO and all I found was a similar question for which the accepted answer doesn't really explain how to do this (I'm already handling webBrowser1_DocumentCompletedwebBrowser1_DocumentCompleted). Any tips?

Update: All my searches so far yielded nothing in regard to using WebBrowser control to fetch JSON responses. Perhaps I am approaching this completely wrong? What am I missing?

I POST to website's JSON-response URL using WebBrowser.Navigate().

All goes well, including the webBrowser1_DocumentCompleted() event handler being called.

But instead of getting a "quiet" response (e.g. webBrowser1.Document) that I can handle programmatically, I receive a File Download dialog box:

enter image description here

If I click the Save button and later examine the file, it contains exactly the JSON response that I expect.

But I want the program capture this JSON response in-code, without displaying that dialog and having to click the Save button.

How do I capture JSON response using WebBrowser control?

Note: before posting this question I searched SO and all I found was a similar question for which the accepted answer doesn't really explain how to do this (I'm already handling webBrowser1_DocumentCompleted). Any tips?

Update: All my searches so far yielded nothing in regard to using WebBrowser control to fetch JSON responses. Perhaps I am approaching this completely wrong? What am I missing?

I POST to website's JSON-response URL using WebBrowser.Navigate().

All goes well, including the webBrowser1_DocumentCompleted() event handler being called.

But instead of getting a "quiet" response (e.g. webBrowser1.Document) that I can handle programmatically, I receive a File Download dialog box:

enter image description here

If I click the Save button and later examine the file, it contains exactly the JSON response that I expect.

But I want the program capture this JSON response in-code, without displaying that dialog and having to click the Save button.

How do I capture JSON response using WebBrowser control?

Note: before posting this question I searched SO and all I found was a similar question for which the accepted answer doesn't really explain how to do this (I'm already handling webBrowser1_DocumentCompleted). Any tips?

Update: All my searches so far yielded nothing in regard to using WebBrowser control to fetch JSON responses. Perhaps I am approaching this completely wrong? What am I missing?

added 184 characters in body
Source Link
scatmoi
  • 2k
  • 4
  • 19
  • 32

I POST to website's JSON-response URL using WebBrowser.Navigate().

All goes well, including the webBrowser1_DocumentCompleted() event handler being called.

But instead of getting a "quiet" response (e.g. webBrowser1.Document) that I can handle programmatically, I receive a File Download dialog box:

enter image description here

If I click the Save button and later examine the file, it contains exactly the JSON response that I expect.

But I want the program capture this JSON response in-code, without displaying that dialog and having to click the Save button.

How do I capture JSON response using WebBrowser control?

Note: before posting this question I searched SO and all I found was a similar question for which the accepted answer doesn't really explain how to do this (I'm already handling webBrowser1_DocumentCompleted). Any tips?

Update: All my searches so far yielded nothing in regard to using WebBrowser control to fetch JSON responses. Perhaps I am approaching this completely wrong? What am I missing?

I POST to website's JSON-response URL using WebBrowser.Navigate().

All goes well, including the webBrowser1_DocumentCompleted() event handler being called.

But instead of getting a "quiet" response (e.g. webBrowser1.Document) that I can handle programmatically, I receive a File Download dialog box:

enter image description here

If I click the Save button and later examine the file, it contains exactly the JSON response that I expect.

But I want the program capture this JSON response in-code, without displaying that dialog and having to click the Save button.

How do I capture JSON response using WebBrowser control?

Note: before posting this question I searched SO and all I found was a similar question for which the accepted answer doesn't really explain how to do this (I'm already handling webBrowser1_DocumentCompleted). Any tips?

I POST to website's JSON-response URL using WebBrowser.Navigate().

All goes well, including the webBrowser1_DocumentCompleted() event handler being called.

But instead of getting a "quiet" response (e.g. webBrowser1.Document) that I can handle programmatically, I receive a File Download dialog box:

enter image description here

If I click the Save button and later examine the file, it contains exactly the JSON response that I expect.

But I want the program capture this JSON response in-code, without displaying that dialog and having to click the Save button.

How do I capture JSON response using WebBrowser control?

Note: before posting this question I searched SO and all I found was a similar question for which the accepted answer doesn't really explain how to do this (I'm already handling webBrowser1_DocumentCompleted). Any tips?

Update: All my searches so far yielded nothing in regard to using WebBrowser control to fetch JSON responses. Perhaps I am approaching this completely wrong? What am I missing?

Source Link
scatmoi
  • 2k
  • 4
  • 19
  • 32

How to capture JSON response using WebBrowser control

I POST to website's JSON-response URL using WebBrowser.Navigate().

All goes well, including the webBrowser1_DocumentCompleted() event handler being called.

But instead of getting a "quiet" response (e.g. webBrowser1.Document) that I can handle programmatically, I receive a File Download dialog box:

enter image description here

If I click the Save button and later examine the file, it contains exactly the JSON response that I expect.

But I want the program capture this JSON response in-code, without displaying that dialog and having to click the Save button.

How do I capture JSON response using WebBrowser control?

Note: before posting this question I searched SO and all I found was a similar question for which the accepted answer doesn't really explain how to do this (I'm already handling webBrowser1_DocumentCompleted). Any tips?