Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by striche · Jan 10, 2013 at 02:52 PM · webplayerwwwhttpwebrequest

Is HttpWebRequest supposed to work in Web Builds or not?

So, I created a little mini-project to test using an HttpWebRequest object to make Facebook Graph calls on each of the Unity target platforms. I did this successfully on the following platforms: Editor, OSX Desktop, Windows Desktop, iOS.

However, I ran into a problem when trying a Web Player build. I got the follow exception when I tired to call HttpWebRequest.Create(). System.NotSupportedException: http://graph.facebook.com/4?fields=cover at System.Net.WebRequest.GetCreator (System.String prefix) [0x00000] in :0 at System.Net.WebRequest.Create (System.Uri requestUri) [0x00000] in :0 at System.Net.WebRequest.Create (System.String requestUriString) [0x00000] in :0 at GraphProof.ExecuteHttpWeb ()[0x00000] in :0

According to Unity Documentation at http://docs.unity3d.com/Documentatio...atibility.html HttpWebRequest should function in the Web Player. Here is a screen capture of the line in question on the MonoCompatibility page: http://s8.postimage.org/yw3tlqitx/Ht...patibility.png.

Is the documentation in error, or could I be doing something wrong (keeping in mind that it worked fine on every other platform I tried).

Update: Also, not looking for anyone to point me to alternatives, I'm aware of things like the WWW class and UniWeb. The targeting of HttpWebRequest is intentional .

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Bunny83 · Jan 10, 2013 at 08:55 PM

The class should work, however some related classes are not supported, so it depends on how you use the webrequest. Also you can't use it to access a third party site due to the SecuritySandbox. The webrequest is of course build on top of .NET sockets. So that would require Facebook to run a crossdomain policy server which they don't run.

I never tried something like that, but this might help.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image striche · Jan 11, 2013 at 01:56 PM 0
Share

I have verified that the exact line throwing the "NotSupportedException" is the HttpWebRequest.Create call. Since even creating an instance of the class is not possible it would appear that it is case of it simply not working, at all, rather than not working based on a specific method of use.

Your answer

Hint: You can notify a user about this post by typing @username

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

Answers Answers and Comments

9 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Any way to speed up WWW requests? 2 Answers

Is WWW class usable in Android platform? 1 Answer

WWW Request runs in Editor but not in Webplayer 1 Answer

WWW POST request headers gone on webplayer facebook 1 Answer

Detect if webplayer is supported or not from UserAgent 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges