- Home /
Edior sends a bad www request while webplayer does not
I have an annoying problem.
I am requesting a texture using the WWW class. The browser(just writing the url in the url line) and the webplayer version respond as expected yet the editor keeps showing me the "Bad Request" html text body.
The same string that works on the browser and webplayer, and does not work in the editor, does work if I set the string for the url hardcoded, meanin - if I do: new WWW( "http://myrequest" ) - its ok. but not if I do: new WWW( myStringCreatingFunction() ) => bad request.
What could I be missing>
Answer by Graham-Dunnett · Jun 01, 2011 at 12:59 PM
The editor uses an application called Curl to do the web request for you. Curl can do lots of different things, and needs the http:// to tell it to make a http request. When your code runs inside the web browser unity uses the web browser to make requests and the browser assumes you want a http-request (it's a web browser after all).
Put another way, the http:// is not optional. (Just most web browsers these days let you get away without typing it. They add it in behind the scene for you.)
Your answer
Follow this Question
Related Questions
Please help me about this problem 0 Answers
How to Upload multiple files to a server using UnityWebRequest.Post(); 3 Answers
Load a HTML Page into a frame in a browser 1 Answer
Split string data 0 Answers