Select to view content in your preferred language

Problem with Hyphens being converted to %2D

747
2
08-26-2010 01:11 PM
by Anonymous User
Not applicable
I hope someone can help.
I've been playing with the Create WMS Layer Sample from ESRI and was able to get it to work except with this one service.
With this service we need to provide an API key to get access to the service and the API key has hyphens in it. Fiddler shows that the hyphens are being converted by flash to %2D.

I've googled trying to find a solution but none fix the problem.



public function WMSLayer()
    {
        super();
       
        setLoaded(true); // Map will only use loaded layers
       
        // init constant parameter values
        _params = new URLVariables();
        _params.request = "GetMap";
        _params.APIKey = "#######-####-####-####-##########"; 
        _params.transparent = true;
        _params.format = "image/jpeg";
        _params.version = "1.1.1";
        _params.layers = "WebTools"; 
        _params.styles = "";
        _params.service = "WMS";
        _params.BILLINGUNIT = "testCustomer2";


       
        var url:String = "http://wms.sample.ca/WMSServer.aspx?";
        _urlRequest = new URLRequest(url);
        _urlRequest.data = _params; // set params on URLRequest object
    }

The URL looks like this.
http://wms.sample.ca/WMSServer.aspx?"Layers=test&APIKey=#######%2D####%2D####%2D####%2D########## 

Any ideas how to preserve the URL string to have hyphens?
Tags (2)
0 Kudos
2 Replies
DasaPaddock
Esri Regular Contributor
Try making it part of the url instead of the params.
0 Kudos
by Anonymous User
Not applicable
Try making it part of the url instead of the params.


Perfect! Simple solution and it fixed my problem.

Thank you
0 Kudos