x


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>

more ▼

asked Jun 01 '11 at 10:24 AM

Guy 3 gravatar image

Guy 3
61 2 2 5

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

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.)

more ▼

answered Jun 01 '11 at 12:59 PM

Graham Dunnett gravatar image

Graham Dunnett ♦♦
12.8k 11 20 66

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x548
x73

asked: Jun 01 '11 at 10:24 AM

Seen: 693 times

Last Updated: Jun 01 '11 at 12:59 PM