Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
0
Question by datvm · Nov 11, 2015 at 09:38 PM · networkingnetworkwebcompatibilitycookie

Unity Web Request with Header/Cookie support?

So I have run into the problem of needing the usage of Cookie (not for Web Player, but for Windows game). Running around this Answer and the forum, I see the best I can do is manually set the headers of request and get the response header. I am ok with that, because I am originally ASP.NET MVC developer.

However, I then realize they use Dictionary for both the request and response. Now that's the problem. We know that the header can be duplicated, in my case is the Set-Cookie.

Then I tried another, and find out UnityWebRequest class, which is still in UnityEngine.Experimental.Networking namespace (so I suppose it is still in beta?), but I try my luck anyway; only sad to realize they also use Dictionary for header items.

So now my only chance is the vanilla .NET WebRequest (in System.Net namespace). However, I see no documentation on the .NET Framework compability in Unity. Can anyone tell me if it is supported on most platform? My main targets are Windows, Android and Web. If possible, even for WebClient would be nicer.

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 Briksins · Dec 08, 2015 at 11:59 PM

Hi @datvm

To be honest to moved away from unity "www" class long time ago and I was using native C# WebClient, it definitely works on most of the platforms.

Now since Unity 5.2, they introduced "UNET" - new networking for Multiplayer together with new UnityWebRequest which is a replacement for old "www" class.

To be honest, right now I'm checking up on what they did with new "UnityWebRequest", and still find WebClient better and more flexible, especially with it async stuff... By some reason Unity still stacked with their Coroutine, which are slower then async and in general, I prefer to deal with delegates and callbacks. There is one downside of async callbacks which u have to consider - they are received in non-Main thread where most of the unity stuff (like physics, UI etc..) is not accessible. So you would need to implement some sort of buffering queue to enqueue response from non-Main thread, and deque it on next "Update" which is the Main thread.

Just in case you can check my old blog post about Coroutines and Async

Comment
Add comment · 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

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

43 People are following this question.

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

Related Questions

Network Multiple Cameras 4 Answers

[UNET] Client cannot call [Command]s, only the host can 1 Answer

How should I verify that all of my client Object are created and ready after loading a new scene? 0 Answers

How do I properly deal with Internal_CloneSingle can only be called from the main thread 0 Answers

NetworkLobbyManager Manually ServerChangeScene ignores to create server object 1 Answer


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