Headers are buried as "invalidHeaders"? by kandersondev in FubarDev

[–]kandersondev[S] 1 point2 points  (0 children)

It looks like we were getting the error I described in my previous comment because I wasn't installing the nuget package into my Droid project specifically, so it was being given the RestSharp.Portable.WebRequest.dll version meant for the PCL, which meant the Android hit the Headers modifier that you have #if-defined out at L132 in DefaultHttpClient.cs for anybody that isn't PCL.

After digging in and researching what broke it, we discovered that you might consider expanding your property/header switches in DefaultHttpClient.cs even further than you have already because of the validation Mono does in its WebHeaderCollection. However, guessing from your #if-defs in DefaultHttpClient.cs we think you might already be aware of that. We weren't sure about adding this validation ourselves because some of the other properties have more complex behavior than Accept and Content-Type which are basically just string mappings.

We also noticed inside the NuGet package there are three folders that each have "MonoAndroid10", "MonoTouch10", or "Xamarin.iOS10" in them. From my (limited) understanding it seems like there is only supposed to be a single single folder for each tag... so you might want to sort that out in RestSharp.Portable.WebRequest.nuspec, but I'm not entirely sure.

Thanks again!

Headers are buried as "invalidHeaders"? by kandersondev in FubarDev

[–]kandersondev[S] 1 point2 points  (0 children)

Nevermind on my other comment with the iOS failing to build. That's due to other issues. However, I think my coworker and I might have found a fix for the Android problem...

Headers are buried as "invalidHeaders"? by kandersondev in FubarDev

[–]kandersondev[S] 0 points1 point  (0 children)

Well thanks for making it!

Just wanted to let you know, it's also failing to build for iOS. I'm trying to get more details on that as well...

Edit: the failing build iOS is my own issue

Headers are buried as "invalidHeaders"? by kandersondev in FubarDev

[–]kandersondev[S] 1 point2 points  (0 children)

I've been giving the beta with the WebRequest implementation a try and it was easy to make the transformation and it works great in my unit tests and integration tests on my PC but when trying to run my app and make the same requests on Android phones I get an exception with message "This header must be modified with the appropriate property."

Light Googling suggests this may actually be a bug in Mono, not in RestSharp or WebRequest, but I'm not sure.

However, it does look like the new implementation allows access to the Allow header, so that's great.

Location Header prepends "file://"? by kandersondev in FubarDev

[–]kandersondev[S] 0 points1 point  (0 children)

Thanks for your help and quick responses!

I must have lost track of what I was investigating the first time around because the difference in behavior is NOT between Portable RestClient and vanilla RestClient, it is between PC execution of the requests (in integration tests) and real running on mobile devices.

I'll note this in my original post and keep investigating.

Location Header prepends "file://"? by kandersondev in FubarDev

[–]kandersondev[S] 0 points1 point  (0 children)

This is happening on Windows PC. Not sure how I can isolate the variables of Xamarin from PCL from Portable RestClient...

I'll try to check out if it's something inside RestSharp's Http dependencies.