andyburke / UnityHTTP

A TcpClient-based HTTP library for Unity.
GNU General Public License v2.0
589 stars 147 forks source link

Cannot integrate UnityHTTP in Version 5.0.1f1 #38

Closed flyrev closed 5 years ago

flyrev commented 9 years ago

I get compile errors when trying to integrate UnityHTTP in my project.

Steps: cd Library/Plugins

git clone git@github.com:andyburke/UnityHTTP.git

I then get the error

Assets/Plugins/UnityHTTP/src/Request.cs(80,13): error CS0030: Cannot convert type `System.Collections.Generic.KeyValuePair<string,string>' to `System.Collections.DictionaryEntry'

What is wrong? It Unity 5 not supported? Should the code reside in a different place? Is there a different import process I should use?

franzbischoff commented 9 years ago

Unity5 (I don't know about Unity 4) has this class field: http://docs.unity3d.com/ScriptReference/WWWForm-headers.html

with type Dictionary<string,string>

You must edit the line 80 and change from this:

foreach ( DictionaryEntry entry in form.headers )

to this:

foreach ( KeyValuePair<string,string> entry in form.headers )
romansavrulin commented 9 years ago

or just

foreach ( var entry in form.headers )
flyrev commented 5 years ago

Thanks