If an NSURLProtocol subclass is used with NSURLSession the request body is nil

Originator:sduke
Number:rdar://20748671 Date Originated:29-Apr-2015 07:15 PM
Status:Open Resolved:
Product:iOS SDK Product Version:8.x
Classification:1 - High Reproducible:
 
Summary:
https://github.com/samskiter/testnsurlprotocol

When using NSURLConnection, all is fine. But when using NSURLSession, the body is nil

Steps to Reproduce:
Open the sample app, run it.

Expected Results:
The request available in the NSURLProtocol should contain the HTTPBody submitted

Actual Results:
The HTTPBody is nil

Version:
8.x

Notes:


Configuration:
Simulators and devices

Attachments:

Comments

Worth noting, that Apple has demonstrated this field should be available in their example project: https://developer.apple.com/library/ios/samplecode/CustomHTTPProtocol/Listings/CustomHTTPProtocol_Core_Code_CanonicalRequest_m.html#//apple_ref/doc/uid/DTS40013653-CustomHTTPProtocol_Core_Code_CanonicalRequest_m-DontLinkElementID_8


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!