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
2
Question by grey · Jul 21, 2010 at 11:19 PM · wwwgethttppostheaders

HTTP Response Headers?

I see how to set headers for GET and POST, but how do I get the headers on the response? There's data there that I need to read.

Comment
Add comment · Show 1
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 Isoqa0 · Sep 03, 2014 at 02:36 PM 0
Share

So, how can I get the response headers returned by the server? Nothing in the WWW class, and how would it work with Webclient? (Net Framework)

3 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Lucas Meijer 1 · Aug 01, 2010 at 10:01 PM

We added support for responseheaders to the WWW class in Unity3.

Comment
Add comment · Show 8 · 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 Bunny83 · Jan 28, 2011 at 03:09 AM 1
Share

Yeah just found it thanks to C# intellisense. The responseHeaders shouldn't be a HashTable because eg. "Set-Cookie:" can be included multiple times in one response header. The HashTable can only contain one "Set-Cookie:". Would be nice to have a fix for this, anytime ;)

avatar image DaveA · Apr 29, 2011 at 08:06 PM 0
Share

Whoa, not in the docs (as of 4//29/11)?

avatar image oskilian · Jun 28, 2011 at 06:37 AM 0
Share

How does this work? The documentation has no information on this.

avatar image Bunny83 · Jul 04, 2011 at 01:52 PM 0
Share

It's just a Hashtable. Just query the header you want to read:

 // C#
 string cookie = www.responseHeaders["Set-Cookie"];
 
 // JS
 var cookie = www.responseHeaders["Set-Cookie"];
avatar image Aubrey-Falconer · Dec 22, 2011 at 06:34 PM 2
Share

Why can't ResponseHeaders be read before the requested file is completely downloaded? It would be quite nice if I could show players how many $$anonymous$$B are left to go in their AssetBundle download while they watch a bar slide across their screens. (Also see here: http://answers.unity3d.com/questions/196661/extra-www-download-statistics.html?viewedQuestions=196657&viewedQuestions=196344 )

Show more comments
avatar image
1

Answer by Simon Wittber · Jan 31, 2011 at 06:51 AM

UniWeb provides complete support for HTTP. It should support everything you need.

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 hothead_ryan · Jan 15, 2014 at 12:46 AM 0
Share

When making a response promoting your own product, you should really include a disclaimer

avatar image
-1

Answer by Mike 3 · Jul 22, 2010 at 12:13 AM

You can't with the default WWW implementation. You'd have to go through the .NET web client class most likely:

http://msdn.microsoft.com/en-us/library/system.net.webclient(VS.80).aspx

Comment
Add comment · Show 3 · 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 grey · Jul 22, 2010 at 02:25 AM 0
Share

That is... not so good. Thanks for the response. I have no idea how to do that, so if you happen to have additional insight there, that would be helpful.

avatar image Mike 3 · Jul 22, 2010 at 09:30 AM 0
Share

There are plenty of tutorials around, e.g. http://dotnetperls.com/webclient

avatar image DaveA · Jul 04, 2011 at 07:17 PM 0
Share

This answer is obsolete

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

7 People are following this question.

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

Related Questions

WWW Form upload with header not working 2 Answers

Using POST/GET from JavaScript in Webplayer to .php file; How do I set up the data in the php file that is to be transfered? 1 Answer

Error when creating http request. GET request with custom headers is not supported. 3 Answers

Upload large files 0 Answers

GET Request Wrapper 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