# String passed to URLVariables.decode() must be a URL-encoded query string

**URL:** <https://forum.kirupa.com/t/string-passed-to-urlvariables-decode-must-be-a-url-encoded-query-string/240519>\
**Category:** Uncategorized\
**Created:** [October 3, 2007, 4:53pm UTC](https://forum.kirupa.com/t/string-passed-to-urlvariables-decode-must-be-a-url-encoded-query-string/240519 "2007-10-03T16:53:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zomis](https://avatars.discourse-cdn.com/v4/letter/z/e56c9b/32.png) [@Zomis](https://forum.kirupa.com/u/Zomis)\
**Post date:** [October 3, 2007, 4:53pm UTC](https://forum.kirupa.com/t/string-passed-to-urlvariables-decode-must-be-a-url-encoded-query-string/240519/1 "2007-10-03T16:53:34Z")

</div>

I really don’t understand why this won’t work? I’ve made a test which sends some POST data to a script on my page which works fine. But why does not this work?

```auto
            var mapsize = _cmap.fieldx.toString(16) + _cmap.fieldy.toString(16);
            var names = "Zomis_AI6";
            var description = "descr";
            var result = "gameresult";
            var upldata: String = "mapsize="+mapsize+"&names="+names+"&description="+description+"&result="+result;
            trace(upldata);
            var variables:URLVariables = new URLVariables(upldata);
            var request2:URLRequest = new URLRequest();
            request2.url = "http://www.zomis.net/record.php";
            request2.method = URLRequestMethod.POST;
            request2.data = variables;
            var loader2:URLLoader = new URLLoader();
            loader2.dataFormat = URLLoaderDataFormat.VARIABLES;
            loader2.addEventListener(Event.COMPLETE, uploadcomplete);
            try {
                loader2.load(request2);
                trace("Loaded");
            }
            catch (error:Error) {
                trace("Unable to load URL");
            }

```

Tracing gets:

```auto
mapsize=1010&names=Zomis_AI6&description=descr&result=gameresult
Loaded
Error: Error #2101: The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs.
    at Error$/throwError()
    at flash.net::URLVariables/decode()
    at flash.net::URLVariables$iinit()
    at flash.net::URLLoader/flash.net:URLLoader::onComplete()

```
