<font face="Verdana,Arial,Helvetica,sans-serif" size="2"><div>Hi Michael,</div><div><br></div><div>I took a quick look at the URLSession code and it looks like the httpBody isn't being picked up anywhere.&nbsp;</div><div><br></div><div>Could you please create a bug report on&nbsp;<a href="https://bugs.swift.org" target="_blank">https://bugs.swift.org</a> ?<br><font face="Verdana,Arial,Helvetica,sans-serif" size="2"><font><font><div class="socmaildefaultfont" dir="ltr"><div class="socmaildefaultfont" dir="ltr"><div class="socmaildefaultfont" dir="ltr"><div dir="ltr" style="font-style: normal;"><br></div><div dir="ltr" style="font-style: normal;">Thank you!</div><div dir="ltr" style="font-style: normal;"><br><font face="Sans Serif, Verdana, Arial, Helvetica, sans-serif">Pushkar N Kulkarni,</font></div>
<div dir="ltr" style="font-style: normal;"><font face="Sans Serif, Verdana, Arial, Helvetica, sans-serif">IBM Runtimes</font></div><div dir="ltr" style="font-style: normal;"><font face="Sans Serif, Verdana, Arial, Helvetica, sans-serif"><br></font></div><div dir="ltr"><font face="serif, Times New Roman, Times, serif"><i>Simplicity is prerequisite for reliability - Edsger W. Dijkstra</i></font></div>
<div dir="ltr" style="font-style: normal; font-size: 10.5pt; font-family: Arial;"><br></div></div></div></div></font></font></font></div><br><br><font face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size="2" color="#000000"><font color="#990099"><a href="mailto:-----swift-corelibs-dev-bounces@swift.org" target="_blank">-----swift-corelibs-dev-bounces@swift.org</a> wrote: -----</font><div class="iNotesHistory" style="padding-left:5px;"><div style="padding-right:0px;padding-left:5px;border-left:solid black 2px;">To: swift-corelibs-dev &lt;<a href="mailto:swift-corelibs-dev@swift.org" target="_blank">swift-corelibs-dev@swift.org</a>&gt;<br>From: Michael Ferenduros via swift-corelibs-dev <swift-corelibs-dev@swift.org><br>Sent by: <a href="mailto:swift-corelibs-dev-bounces@swift.org" target="_blank">swift-corelibs-dev-bounces@swift.org</a><br>Date: 09/11/2016 02:16AM<br>Subject: [swift-corelibs-dev] Inconsistent URLSession POST behaviour<br><br><div><font face="Courier New,Courier,monospace" size="3">I’m seeing differences between Linux and Mac when trying to do a POST with a URLSessionDataTask - it seems like URLRequest.httpBody is ignored on Linux, so POSTs arrive with an empty body.<br><br>Was I relying on undefined behaviour, or is this just not yet implemented?<br><br>The following captures the difference in behaviour:<br><br>import Foundation<br>import Dispatch<br><br>var req = URLRequest(url: URL(string: "<a href="http://httpbin.org/post">http://httpbin.org/post</a>")!)<br>req.httpMethod = "POST"<br>req.httpBody = "Hello! You should see me in the 'form' parameter of the result.".data(using: .utf8)<br><br>let sesh = URLSession(configuration: URLSessionConfiguration.default)<br><br>let dataTask = sesh.dataTask(with: req) { data, _, _ in<br>        print(String(data: data!, encoding: .utf8)!)<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;exit(0)<br>}<br>dataTask.resume()<br>dispatchMain()<br><br>_______________________________________________<br>swift-corelibs-dev mailing list<br><a href="mailto:swift-corelibs-dev@swift.org" target="_blank">swift-corelibs-dev@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-corelibs-dev">https://lists.swift.org/mailman/listinfo/swift-corelibs-dev</a><br></font></div></swift-corelibs-dev@swift.org></div></div></font></font><BR>