-
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add text return value to DownloadHandlerBuffer reponse #2
Comments
Hi @tomkail could you post an example of your code? |
Sure! Not much to it really: |
The download handler type is determined by the underlying webrequest
you may need to deserialize and/or reencode the string from the binary data. |
Riiight. Makes sense. It's very awkward though! The standard way this type of request is returned is via text, right? |
I think it is determined by the returned content type of the response from the server. |
If you have control of the server, change your MIME content type to json or text.
|
Hm that might be true, but webRequest.downloadHandler?.text does contain the data I'm expecting, so in this case it feels like the plugin is getting in the way of the way UnityWebRequest is already working. |
Ah I see, sure let's add it to the return here
case DownloadHandlerBuffer _:
return new Response(true, webRequest.downloadHandler?.text, webRequest.downloadHandler?.data, webRequest.responseCode); Is this what you're suggesting? |
Yup! |
Give it about 5 min to build, then update to 1.0.2 |
When using the Post functions, DownloadHandlerBuffer is used for the downloadHandler. This results in text not being returned.
I'm not sure if this is by design or not?
The text was updated successfully, but these errors were encountered: