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 Briksins · Jan 05, 2014 at 09:11 PM · serverclienthttpheaders

List of HTTP User-Agent's in Unity for various platforms?

Hello again :)

I'm writing here server(java) and client(unity) for my current project, and one of the security tasks is to skip any request that came not from our client.

One of the things we check in first place is HTTP User-Agent value. But unfortunatly WWWForm doesnt allow to set User-Agent and in Unity Script Refference it is says "Read-Only".

Thats fine with us not being able to modifay "User-Agent" manually as Unity set its own User-Agent. for example when I send request from (Win) Unity Editor, the agent is:
"UnityPlayer/4.3.0f4 (http://unity3d.com)"

but the problem is that I cant find anywhere list of all avaliable headers or even mentioning of how those agents are changed depending on the platform.

Would anyone be able to list common agents for:

Web (Win/OSx)

iOS

Android

as I dont have all equipment to build project test it, and actually project itself is far away from it firs test build.

Thank you in advance :)

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
2
Best Answer

Answer by Briksins · Jan 05, 2014 at 09:28 PM

Ehhh my bad, I find a way to overwrite headers and User-Agent.

     private IEnumerator CoroutineWebRequest(string post)
     {
 
 //        WWWForm POSTform = new WWWForm();
 //        POSTform.AddField("data", post);
         Hashtable headers = new Hashtable();
         headers.Add("User-Agent", userAgent);
         string data = "data=" + post;
         WWW www = new WWW(finalUrl, Encoding.UTF8.GetBytes(data), headers);
 * * # Skipped # * *


As you see you dont need to use WWWForm, you can just convert your post data string to bytes and create hashtable with headers you need

in WWW class it is 4th method:

 WWW(string url, byte[] postData, Hashtable headers);

Sorry for creating taht question without doing proper research! but hope it will help someone silly like me in the future :)

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 subbu5280 · Jan 20, 2016 at 09:48 AM 0
Share

Can you please explain more for getting uesr-Agent id.when i use above code i am getting more errors.

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

19 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

Related Questions

how to Post link ( Ruby Script) through unity3d ? 1 Answer

iOS using the client as the server 0 Answers

Help with multiplayer connection 0 Answers

Network how to send data/activate function 1 Answer

Server and Network no communication 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