# sendToURL without passing data or variables

**URL:** <https://forum.kirupa.com/t/sendtourl-without-passing-data-or-variables/324396>\
**Category:** flash\
**Created:** [August 18, 2011, 3:36pm UTC](https://forum.kirupa.com/t/sendtourl-without-passing-data-or-variables/324396 "2011-08-18T15:36:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jsemily](https://avatars.discourse-cdn.com/v4/letter/j/5f9b8f/32.png) [@jsemily](https://forum.kirupa.com/u/jsemily)\
**Post date:** [August 18, 2011, 3:36pm UTC](https://forum.kirupa.com/t/sendtourl-without-passing-data-or-variables/324396/1 "2011-08-18T15:36:56Z")

</div>

I’m working on an interactive quiz where the user’s responses will be incremented to a poll in a CMS. I have a url that automatically increments the answer choice in a poll, so I would like to use sendToURL to call the url without actually passing any data or variables. It seems to work with navigateToURL, but that opens a blank window in the browser (a complete nuisance every time you answer a quiz question).

Here is the navigateToURL code that increments the poll successfully, but opens the unwanted browser window

```
        var url:String = "[URL GOES HERE](http://polls.clickability.com/polls?pid=)"; 
        var request:URLRequest = new URLRequest(url); 
        try {
            navigateToURL(request);
        } catch (e:Error) {
            trace("Navigate to URL failed", e.message); 
        }

```

Here is the URLRequestMethod.POST code that increments the poll, but throws an error and distrupts other things because I’m feeding it a dummy variable.

```
        var variables:URLVariables = new URLVariables("name=Franklin");
        var request:URLRequest = new URLRequest();
        request.url = "URL GOES HERE";
        request.method = URLRequestMethod.POST;
        request.data = variables;
        var loader:URLLoader = new URLLoader();
        loader.dataFormat = URLLoaderDataFormat.VARIABLES;
        loader.addEventListener(Event.COMPLETE, completeHandler);
        try
        {
            loader.load(request);
        }
        catch (error:Error)
        {
            trace("Unable to load URL");
        }

        function completeHandler(event:Event):void
        {
            trace(event.target.data.welcomeMessage);
        }

```

Suggestions? I tried replacing “navigateToURL” in the first option to sendToURL and it wasn’t incrementing the poll.
