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 /
avatar image
0
Question by Klingee · May 23, 2011 at 11:47 AM · webplayerwwwstandalonewwwformbuffer

WWW zero sized post buffer error Standalone

Hi

When I try to make a WWW request via a WWWForm I allways get an error saying: "You are trying to load data from a www stream which had the following error when downloading. Error when creating request. POST request with a zero-sized post buffer is not supported. UnityEngine.WWW:get_text()" This however only happens if the Platform in the Build Settings is set to "PC and MAC Standalone". If I switch the platform to Web Player everything works perfectly. Anyone an idea what might be causing this? Thx in advance.

 private void MakeRequest(Uri url, HttpVerb httpVerb,
                                Dictionary<string, string> args, Action<JsonData> method)
     {
         string requestString = url.ToString();

         if (args != null && args.Keys.Count > 0 && httpVerb == HttpVerb.GET)
         {
             requestString += EncodeDictionary(args, true);
         }

         WWWForm form = new WWWForm();

         // Create a download object
         download = new WWW(requestString, form);

         if(method != null)
             StartCoroutine(WaitForDownload(download, method));
     }

     private IEnumerator WaitForDownload(WWW download, Action<JsonData> method)
     {
         yield return download;

         JsonData data;

         if (download.error == null)
         {
             Debug.Log(download.text);
             data = JsonMapper.ToObject(download.text);
         }
         else
         {
             Debug.Log(download.error);

             string error = "{\"" + "error\"" + " : " + "\"" + download.error + "\"" + "}";
             Debug.Log(error);
             data = JsonMapper.ToObject(error);
         }

         if(method != null)
             method(data);
     }
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
1

Answer by Mike 3 · May 23, 2011 at 01:31 PM

Do you need to send the data as POST instead of GET?

If not, you could skip on the WWWForm and just do new WWW(requestString)

If you do, I guess you could add some (short) simple data into the form so it doesn't give you the error, though send in a bug report about it

Comment
Add comment · Show 2 · 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 · May 23, 2011 at 02:38 PM 0
Share

I would do the same. If you need a POST request but you don't care for any posted data, just do form.data = new byte[1]{0}; or something like that. If you don't need a POST just remove the WWWForm. The error is quite self explaining ;)

avatar image Bunny83 · May 23, 2011 at 02:39 PM 0
Share

Ahh, my bad... WWWForm.data is read only... You have to use AddField ins$$anonymous$$d :/

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

2 People are following this question.

avatar image avatar image

Related Questions

Unity5 WebPlayer WWWForm working only in Google Chrome 3 Answers

www in web player and standalone 3 Answers

Disable execute/write permissions on PHP files while maintaining the ability to execute them from Unity? 1 Answer

WWW Request runs in Editor but not in Webplayer 1 Answer

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