web service

Hi am trying to get data back from a web service, the script does not have any problem communicating with the service but this is all gets returned in www.text

Bad Request

Bad Request


HTTP Error 400. The request is badly formed.

I know the web service is working as it has been running for several months now, and if I simply paste the url into a web browser the expected string is returned, but using the exact same url in WWW(url) does not work.

There does seem to be a lot of people having difficulty using web services with Unity and frankly if we can’t get this to work we’ll have to give up on Unity and try something else.

Thanks for any help in advance

I am having this same problem. Any information would be amazing.

What’s the request?

I just figured out what my problem was and it may work for you as well. In my URL there was a " " (space) and it didn’t like that in the URL sent through curl. If you change the " " to “%20” that works, also you maybe able to make your URL work using the www.escapeURL that unity has. I think it would work if you did something like this:

url = WWW.escapeURL( url );
WWW request ( url );

Definitely, you need to escape your url. fyi, 20 is the hexadecimal number representing ‘space’ in the ascii table.