Bug 52750 - NSUrlSessionHandler PUT POST FAILURE
Summary: NSUrlSessionHandler PUT POST FAILURE
Status: RESOLVED DUPLICATE of bug 52682
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2017-02-24 16:06 UTC by Andrew
Modified: 2017-02-24 22:33 UTC (History)
5 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Andrew 2017-02-24 16:06:48 UTC
this just started with today. 

probably related to: https://bugzilla.xamarin.com/show_bug.cgi?id=52711

POST and PUT are failing with NSUrlSessionHandler.

this.Client = new HttpClient(new NativeMessageHandler());

I can change the code to use the NativeMessageHandler and it works.

this.Client = new HttpClient(new NSUrlSessionHandler());

This worked before the latest update by Xamarin yesterday:

Xamarin Studio Enterprise
Version 6.2 (build 1821)
Installation UUID: c6cc2bf2-3d75-4e51-bb1f-b12a2a84f591
	Mono 4.8.0 (mono-4.8.0-branch/e4a3cf3) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 408000495


Version: 1.2.0
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

Apple Developer Tools
Xcode 8.2.1 (11766.1)
Build 8C1002

Version: (Visual Studio Enterprise)
Hash: 35d1ccd
Branch: cycle9
Build date: 2017-02-16 17:40:00-0500

Version: (Visual Studio Enterprise)

Version: (Visual Studio Enterprise)
Android SDK: /Users/mccorma/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
		5.1    (API level 22)
		6.0    (API level 23)
		7.0    (API level 24)
		7.1    (API level 25)

SDK Tools Version: 25.2.5
SDK Platform Tools Version: 25.0.3
SDK Build Tools Version: 25.0.2

Java SDK: /usr
java version "1.8.0_91"
Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)

Android Designer EPL code available here:

Xamarin Android Player
Not Installed

Build Information
Release ID: 602001821
Git revision: d41b6e51f3fa46a1943f2e31a778d28a7c73d069
Build date: 2017-02-17 15:18:19-05
Xamarin addins: 1363a8d943bab7700c93a97474060b6734aa7f94
Build lane: monodevelop-lion-cycle9

Operating System
Mac OS X 10.11.6
Darwin ITM-mccorma-f8j8.local 15.6.0 Darwin Kernel Version 15.6.0
    Mon Jan  9 23:07:29 PST 2017
    root:xnu-3248. x86_64

Enabled user installed addins
Gorilla Player
Comment 1 Andrew 2017-02-24 16:09:16 UTC
wrong order for fails and works.

this.Client = new HttpClient(new NSUrlSessionHandler());

this.Client = new HttpClient(new NativeMessageHandler());
Comment 2 Paul DiPietro [MSFT] 2017-02-24 16:13:59 UTC
Reassigning to iOS team to see what their immediate input on it is.
Comment 3 Andrew 2017-02-24 16:15:53 UTC
Thanks.  I have to modify all my code to change the handler.  not fun.  

If you fix this bug, it would resolve this bug most likely

Comment 4 Sebastien Pouliot 2017-02-24 22:20:46 UTC
We believe this to be a duplicate of #52682 which has a test case.

If your test case differs from it then please attach it to the bug report so we can make sure it's tested and integrated in our regression tests. Thanks!

*** This bug has been marked as a duplicate of bug 52682 ***
Comment 5 Sebastien Pouliot 2017-02-24 22:30:57 UTC
> Thanks.  I have to modify all my code to change the handler.  not fun.  

If you use 

> this.Client = new HttpClient();

then you can switch the default handler from your project options, i.e. from a single place. That makes it a lot easier to switch and test things (and it also works for PCL-based code which can't change the handler).
Comment 6 Andrew 2017-02-24 22:33:12 UTC
from testing: 

this.Client = new HttpClient();  

does the same thing. fails on POST or PUT. GET works.

this is the only thing that seems to work:
this.Client = new HttpClient(new NativeMessageHandler());

I am using a Dependency service.