I have a post request in the program through the webbrowser component. The answer comes json content, but the browser returns it not to webBrowser1.DocumentText, but creates a dialog box to save the file and waits for confirmation of the action. Is it possible to cancel the creation of a dialog box, or specify how exactly to get json content, that is, as the content of the page, and not the file?

    1 answer 1

    The program does not know how and with what you open this format. To prevent opening, you need to let it know what to do with the file type. If I'm not mistaken, then this control is based on IE, you need to start it and in the options configure an action for this type of file.

    • I tried to prohibit the download, anyway, a window appears, indicating the ban. - Artem Balan
    • one
      Be sure to use the web control, can you get along with HttpWebRequest? - Daniel Protopopov
    • I had to use it, on the page of the site with which the program works, several hundreds of checkboxes and each value is transmitted in the request parameters, it’s unrealistic to collect them by hand. I had to use the browser: fill the page elements where needed, found the button, clicked and order) - Artem Balan
    • If this is some kind of automation, then it will be more convenient to do it in Selenium or the like. In other cases, you can simply ignore the return (POST) and continue working after the redirect (sent and forgotten) - Daniel Protopopov