Skip to content

Commit 10486ac

Browse files
committed
Merge #166
2 parents fce735a + d77b173 commit 10486ac

File tree

9 files changed

+288
-22
lines changed

9 files changed

+288
-22
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
* Adjusted parsing of Mocktail files to allow headers to start on line 4.
1212
[@Ashton-W](https://github.com/Ashton-W), [#172](https://github.com/AliSoftware/OHHTTPStubs/pull/172)
1313

14+
* Allows access to the `HTTPBody` of POST request when using `NSURLSession` [(Wiki entry)](https://github.com/AliSoftware/OHHTTPStubs/wiki/Testing-for-the-request-body-in-your-stubs)
15+
[@iosphere](https://github.com/iosphere/), [#166](https://github.com/AliSoftware/OHHTTPStubs/pull/166)
16+
1417
## [5.0.0](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/5.0.0)
1518

1619
* Added `pathStartsWith(_:)` to the `Swift` helpers.

OHHTTPStubs.podspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ Pod::Spec.new do |s|
5353
s.subspec 'NSURLSession' do |urlsession|
5454
urlsession.dependency 'OHHTTPStubs/Core'
5555
urlsession.source_files = "OHHTTPStubs/Sources/NSURLSession/*.{h,m}"
56+
urlsession.private_header_files = "OHHTTPStubs/Sources/NSURLSession/OHHTTPStubsMethodSwizzling.h"
5657
end
5758

5859
s.subspec 'JSON' do |json|

OHHTTPStubs/OHHTTPStubs.xcodeproj/project.pbxproj

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@
8686
09D0D29B1B67FF06004E7213 /* Compatibility.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 09D0D2981B67FED3004E7213 /* Compatibility.h */; };
8787
0D4BF5A17B4778591F08161F /* libPods-OHHTTPStubs tvOS Fmk Tests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BA8213D8FBCA73CF0607478B /* libPods-OHHTTPStubs tvOS Fmk Tests.a */; };
8888
0DB397E35DDB6808A5496D53 /* libPods-OHHTTPStubs Mac Tests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F49690D948DE88BBB4A36B11 /* libPods-OHHTTPStubs Mac Tests.a */; };
89+
1B5632F01CB2A9C200388C9B /* OHHTTPStubsMethodSwizzling.h in Headers */ = {isa = PBXBuildFile; fileRef = 1B5632EE1CB2A9C200388C9B /* OHHTTPStubsMethodSwizzling.h */; };
90+
1B5632F11CB2A9C200388C9B /* OHHTTPStubsMethodSwizzling.h in Headers */ = {isa = PBXBuildFile; fileRef = 1B5632EE1CB2A9C200388C9B /* OHHTTPStubsMethodSwizzling.h */; };
91+
1B5632F21CB2A9C200388C9B /* OHHTTPStubsMethodSwizzling.h in Headers */ = {isa = PBXBuildFile; fileRef = 1B5632EE1CB2A9C200388C9B /* OHHTTPStubsMethodSwizzling.h */; };
92+
1B5632F31CB2A9C200388C9B /* OHHTTPStubsMethodSwizzling.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B5632EF1CB2A9C200388C9B /* OHHTTPStubsMethodSwizzling.m */; };
93+
1B5632F41CB2A9C200388C9B /* OHHTTPStubsMethodSwizzling.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B5632EF1CB2A9C200388C9B /* OHHTTPStubsMethodSwizzling.m */; };
94+
1B5632F51CB2A9C200388C9B /* OHHTTPStubsMethodSwizzling.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B5632EF1CB2A9C200388C9B /* OHHTTPStubsMethodSwizzling.m */; };
95+
1B5632F61CB2A9C200388C9B /* OHHTTPStubsMethodSwizzling.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B5632EF1CB2A9C200388C9B /* OHHTTPStubsMethodSwizzling.m */; };
8996
1D0F8E7E1B6E31850049A7D2 /* MocktailTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D0F8E7D1B6E31850049A7D2 /* MocktailTests.m */; };
9097
1D0F8E801B6E31A70049A7D2 /* login.tail in Resources */ = {isa = PBXBuildFile; fileRef = 1D0F8E7F1B6E31A70049A7D2 /* login.tail */; };
9198
1D0F8E821B6E31B00049A7D2 /* MocktailFolder in Resources */ = {isa = PBXBuildFile; fileRef = 1D0F8E811B6E31B00049A7D2 /* MocktailFolder */; };
@@ -119,6 +126,14 @@
119126
725CD9BB1A9EB71A00F84C8B /* OHHTTPStubsResponse+JSON.h in Headers */ = {isa = PBXBuildFile; fileRef = 09110A721980606A00D175E4 /* OHHTTPStubsResponse+JSON.h */; settings = {ATTRIBUTES = (Public, ); }; };
120127
725CD9BC1A9EB71D00F84C8B /* OHHTTPStubsResponse+HTTPMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = 09110A701980606A00D175E4 /* OHHTTPStubsResponse+HTTPMessage.h */; settings = {ATTRIBUTES = (Public, ); }; };
121128
7B812F8D5510F916B78E671A /* libPods-OHHTTPStubs iOS Lib Tests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BFA846B11753DE97A1D563D0 /* libPods-OHHTTPStubs iOS Lib Tests.a */; };
129+
DC4658561CAD192600344232 /* NSMutableURLRequest+HTTPBodyTesting.m in Sources */ = {isa = PBXBuildFile; fileRef = DC4658541CAD192600344232 /* NSMutableURLRequest+HTTPBodyTesting.m */; };
130+
DC4658571CAD19A200344232 /* NSMutableURLRequest+HTTPBodyTesting.m in Sources */ = {isa = PBXBuildFile; fileRef = DC4658541CAD192600344232 /* NSMutableURLRequest+HTTPBodyTesting.m */; };
131+
DC4658581CAD19A200344232 /* NSMutableURLRequest+HTTPBodyTesting.m in Sources */ = {isa = PBXBuildFile; fileRef = DC4658541CAD192600344232 /* NSMutableURLRequest+HTTPBodyTesting.m */; };
132+
DC46585A1CAD19A300344232 /* NSMutableURLRequest+HTTPBodyTesting.m in Sources */ = {isa = PBXBuildFile; fileRef = DC4658541CAD192600344232 /* NSMutableURLRequest+HTTPBodyTesting.m */; };
133+
DC46585B1CAD245C00344232 /* NSMutableURLRequest+HTTPBodyTesting.h in Headers */ = {isa = PBXBuildFile; fileRef = DC4658551CAD192600344232 /* NSMutableURLRequest+HTTPBodyTesting.h */; settings = {ATTRIBUTES = (Public, ); }; };
134+
DC46585C1CAD245D00344232 /* NSMutableURLRequest+HTTPBodyTesting.h in Headers */ = {isa = PBXBuildFile; fileRef = DC4658551CAD192600344232 /* NSMutableURLRequest+HTTPBodyTesting.h */; settings = {ATTRIBUTES = (Public, ); }; };
135+
DC46585D1CAD245E00344232 /* NSMutableURLRequest+HTTPBodyTesting.h in Headers */ = {isa = PBXBuildFile; fileRef = DC4658551CAD192600344232 /* NSMutableURLRequest+HTTPBodyTesting.h */; settings = {ATTRIBUTES = (Public, ); }; };
136+
DC46585E1CAD260F00344232 /* NSMutableURLRequest+HTTPBodyTesting.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DC4658551CAD192600344232 /* NSMutableURLRequest+HTTPBodyTesting.h */; };
122137
EA100ABC1BE15BE400129352 /* OHHTTPStubs.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EAA436A51BE1598D000E9E99 /* OHHTTPStubs.framework */; };
123138
EA9D27231BE15C740078CAA0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA9D27221BE15C740078CAA0 /* Foundation.framework */; };
124139
EA9D27241BE15CA00078CAA0 /* empty.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 221C34A61B0CCF9D00FCA8FF /* empty.bundle */; };
@@ -191,6 +206,7 @@
191206
dstPath = "include/$(PRODUCT_NAME)";
192207
dstSubfolderSpec = 16;
193208
files = (
209+
DC46585E1CAD260F00344232 /* NSMutableURLRequest+HTTPBodyTesting.h in CopyFiles */,
194210
09D0D29B1B67FF06004E7213 /* Compatibility.h in CopyFiles */,
195211
095981FC19806AF300807DBE /* OHHTTPStubs.h in CopyFiles */,
196212
095981FD19806AF300807DBE /* OHHTTPStubsResponse.h in CopyFiles */,
@@ -241,6 +257,8 @@
241257
095B1AD31AE30BA7009D1B56 /* OHPathHelpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OHPathHelpers.h; sourceTree = "<group>"; };
242258
095B1AD41AE30BA7009D1B56 /* OHPathHelpers.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OHPathHelpers.m; sourceTree = "<group>"; };
243259
09D0D2981B67FED3004E7213 /* Compatibility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Compatibility.h; sourceTree = "<group>"; };
260+
1B5632EE1CB2A9C200388C9B /* OHHTTPStubsMethodSwizzling.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OHHTTPStubsMethodSwizzling.h; sourceTree = "<group>"; };
261+
1B5632EF1CB2A9C200388C9B /* OHHTTPStubsMethodSwizzling.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OHHTTPStubsMethodSwizzling.m; sourceTree = "<group>"; };
244262
1D0F8E7D1B6E31850049A7D2 /* MocktailTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MocktailTests.m; path = "Test Suites/MocktailTests.m"; sourceTree = "<group>"; };
245263
1D0F8E7F1B6E31A70049A7D2 /* login.tail */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = login.tail; path = ../login.tail; sourceTree = "<group>"; };
246264
1D0F8E811B6E31B00049A7D2 /* MocktailFolder */ = {isa = PBXFileReference; lastKnownFileType = folder; name = MocktailFolder; path = ../MocktailFolder; sourceTree = "<group>"; };
@@ -263,6 +281,8 @@
263281
BFA846B11753DE97A1D563D0 /* libPods-OHHTTPStubs iOS Lib Tests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-OHHTTPStubs iOS Lib Tests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
264282
C0E954CB8F11618F9510F283 /* Pods-OHHTTPStubs iOS Lib Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-OHHTTPStubs iOS Lib Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-OHHTTPStubs iOS Lib Tests/Pods-OHHTTPStubs iOS Lib Tests.debug.xcconfig"; sourceTree = "<group>"; };
265283
DB9708EFC7D95D8EAE91EA78 /* Pods-OHHTTPStubs iOS Fmk Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-OHHTTPStubs iOS Fmk Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-OHHTTPStubs iOS Fmk Tests/Pods-OHHTTPStubs iOS Fmk Tests.release.xcconfig"; sourceTree = "<group>"; };
284+
DC4658541CAD192600344232 /* NSMutableURLRequest+HTTPBodyTesting.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSMutableURLRequest+HTTPBodyTesting.m"; sourceTree = "<group>"; };
285+
DC4658551CAD192600344232 /* NSMutableURLRequest+HTTPBodyTesting.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSMutableURLRequest+HTTPBodyTesting.h"; sourceTree = "<group>"; };
266286
E2483255B84CAC7897D6E98C /* Pods-OHHTTPStubs Mac Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-OHHTTPStubs Mac Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests/Pods-OHHTTPStubs Mac Tests.release.xcconfig"; sourceTree = "<group>"; };
267287
EA100AB71BE15BE400129352 /* OHHTTPStubs tvOS Fmk Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "OHHTTPStubs tvOS Fmk Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
268288
EA9D27221BE15C740078CAA0 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; };
@@ -437,6 +457,10 @@
437457
09110A771980607200D175E4 /* NSURLSession Support */ = {
438458
isa = PBXGroup;
439459
children = (
460+
1B5632EE1CB2A9C200388C9B /* OHHTTPStubsMethodSwizzling.h */,
461+
1B5632EF1CB2A9C200388C9B /* OHHTTPStubsMethodSwizzling.m */,
462+
DC4658551CAD192600344232 /* NSMutableURLRequest+HTTPBodyTesting.h */,
463+
DC4658541CAD192600344232 /* NSMutableURLRequest+HTTPBodyTesting.m */,
440464
09110A781980608600D175E4 /* OHHTTPStubs+NSURLSessionConfiguration.m */,
441465
);
442466
name = "NSURLSession Support";
@@ -577,6 +601,8 @@
577601
0959820119806B1E00807DBE /* OHHTTPStubsResponse+HTTPMessage.h in Headers */,
578602
094906DF1B7F60EE00B047DA /* OHHTTPStubs+Mocktail.h in Headers */,
579603
095B1AD71AE3138C009D1B56 /* OHPathHelpers.h in Headers */,
604+
DC46585C1CAD245D00344232 /* NSMutableURLRequest+HTTPBodyTesting.h in Headers */,
605+
1B5632F11CB2A9C200388C9B /* OHHTTPStubsMethodSwizzling.h in Headers */,
580606
09199FD01BD974F20014376D /* OHHTTPStubsUmbrella.h in Headers */,
581607
);
582608
runOnlyForDeploymentPostprocessing = 0;
@@ -592,6 +618,8 @@
592618
725CD9BC1A9EB71D00F84C8B /* OHHTTPStubsResponse+HTTPMessage.h in Headers */,
593619
094906DE1B7F60E200B047DA /* OHHTTPStubs+Mocktail.h in Headers */,
594620
095B1AD61AE3138C009D1B56 /* OHPathHelpers.h in Headers */,
621+
DC46585B1CAD245C00344232 /* NSMutableURLRequest+HTTPBodyTesting.h in Headers */,
622+
1B5632F01CB2A9C200388C9B /* OHHTTPStubsMethodSwizzling.h in Headers */,
595623
09199FCF1BD974F10014376D /* OHHTTPStubsUmbrella.h in Headers */,
596624
);
597625
runOnlyForDeploymentPostprocessing = 0;
@@ -607,6 +635,8 @@
607635
EAA4369D1BE1598D000E9E99 /* OHHTTPStubsResponse+HTTPMessage.h in Headers */,
608636
EAA4369E1BE1598D000E9E99 /* OHHTTPStubs+Mocktail.h in Headers */,
609637
EAA4369F1BE1598D000E9E99 /* OHPathHelpers.h in Headers */,
638+
DC46585D1CAD245E00344232 /* NSMutableURLRequest+HTTPBodyTesting.h in Headers */,
639+
1B5632F21CB2A9C200388C9B /* OHHTTPStubsMethodSwizzling.h in Headers */,
610640
EAA436A01BE1598D000E9E99 /* OHHTTPStubsUmbrella.h in Headers */,
611641
);
612642
runOnlyForDeploymentPostprocessing = 0;
@@ -1085,6 +1115,8 @@
10851115
isa = PBXSourcesBuildPhase;
10861116
buildActionMask = 2147483647;
10871117
files = (
1118+
DC4658561CAD192600344232 /* NSMutableURLRequest+HTTPBodyTesting.m in Sources */,
1119+
1B5632F31CB2A9C200388C9B /* OHHTTPStubsMethodSwizzling.m in Sources */,
10881120
09110A6C1980605A00D175E4 /* OHHTTPStubs.m in Sources */,
10891121
09110A791980608600D175E4 /* OHHTTPStubs+NSURLSessionConfiguration.m in Sources */,
10901122
1D6DB8501B763B7A00FCF855 /* OHHTTPStubs+Mocktail.m in Sources */,
@@ -1135,11 +1167,13 @@
11351167
095981F619806AAC00807DBE /* OHHTTPStubs.m in Sources */,
11361168
095981FA19806AAC00807DBE /* OHHTTPStubs+NSURLSessionConfiguration.m in Sources */,
11371169
094906D81B7F520200B047DA /* OHHTTPStubs+Mocktail.m in Sources */,
1170+
1B5632F51CB2A9C200388C9B /* OHHTTPStubsMethodSwizzling.m in Sources */,
11381171
095981F719806AAC00807DBE /* OHHTTPStubsResponse.m in Sources */,
11391172
095981F919806AAC00807DBE /* OHHTTPStubsResponse+JSON.m in Sources */,
11401173
095981F819806AAC00807DBE /* OHHTTPStubsResponse+HTTPMessage.m in Sources */,
11411174
0501A1A81C63E0C600B120AE /* OHHTTPStubsSwift.swift in Sources */,
11421175
095B1AD91AE31396009D1B56 /* OHPathHelpers.m in Sources */,
1176+
DC4658581CAD19A200344232 /* NSMutableURLRequest+HTTPBodyTesting.m in Sources */,
11431177
);
11441178
runOnlyForDeploymentPostprocessing = 0;
11451179
};
@@ -1167,11 +1201,13 @@
11671201
725CD9B41A9EB6F600F84C8B /* OHHTTPStubs.m in Sources */,
11681202
725CD9B81A9EB70000F84C8B /* OHHTTPStubs+NSURLSessionConfiguration.m in Sources */,
11691203
094906D71B7F520200B047DA /* OHHTTPStubs+Mocktail.m in Sources */,
1204+
1B5632F41CB2A9C200388C9B /* OHHTTPStubsMethodSwizzling.m in Sources */,
11701205
725CD9B51A9EB6F800F84C8B /* OHHTTPStubsResponse.m in Sources */,
11711206
725CD9B71A9EB6FD00F84C8B /* OHHTTPStubsResponse+JSON.m in Sources */,
11721207
725CD9B61A9EB6FA00F84C8B /* OHHTTPStubsResponse+HTTPMessage.m in Sources */,
11731208
09199FD11BD98D1C0014376D /* OHHTTPStubsSwift.swift in Sources */,
11741209
095B1AD81AE31395009D1B56 /* OHPathHelpers.m in Sources */,
1210+
DC4658571CAD19A200344232 /* NSMutableURLRequest+HTTPBodyTesting.m in Sources */,
11751211
);
11761212
runOnlyForDeploymentPostprocessing = 0;
11771213
};
@@ -1199,11 +1235,13 @@
11991235
EAA4368F1BE1598D000E9E99 /* OHHTTPStubs.m in Sources */,
12001236
EAA436901BE1598D000E9E99 /* OHHTTPStubs+NSURLSessionConfiguration.m in Sources */,
12011237
EAA436911BE1598D000E9E99 /* OHHTTPStubs+Mocktail.m in Sources */,
1238+
1B5632F61CB2A9C200388C9B /* OHHTTPStubsMethodSwizzling.m in Sources */,
12021239
EAA436921BE1598D000E9E99 /* OHHTTPStubsResponse.m in Sources */,
12031240
EAA436931BE1598D000E9E99 /* OHHTTPStubsResponse+JSON.m in Sources */,
12041241
EAA436941BE1598D000E9E99 /* OHHTTPStubsResponse+HTTPMessage.m in Sources */,
12051242
EAA436951BE1598D000E9E99 /* OHHTTPStubsSwift.swift in Sources */,
12061243
EAA436961BE1598D000E9E99 /* OHPathHelpers.m in Sources */,
1244+
DC46585A1CAD19A300344232 /* NSMutableURLRequest+HTTPBodyTesting.m in Sources */,
12071245
);
12081246
runOnlyForDeploymentPostprocessing = 0;
12091247
};
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/***********************************************************************************
2+
*
3+
* Copyright (c) 2016 Sebastian Hagedorn, Felix Lamouroux
4+
*
5+
* Permission is hereby granted, free of charge, to any person obtaining a copy
6+
* of this software and associated documentation files (the "Software"), to deal
7+
* in the Software without restriction, including without limitation the rights
8+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
* copies of the Software, and to permit persons to whom the Software is
10+
* furnished to do so, subject to the following conditions:
11+
*
12+
* The above copyright notice and this permission notice shall be included in
13+
* all copies or substantial portions of the Software.
14+
*
15+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
* THE SOFTWARE.
22+
*
23+
***********************************************************************************/
24+
25+
////////////////////////////////////////////////////////////////////////////////
26+
#pragma mark - Imports
27+
28+
#import <Foundation/Foundation.h>
29+
30+
// This category is only useful when NSURLSession is present
31+
#if defined(__IPHONE_7_0) || defined(__MAC_10_9)
32+
33+
////////////////////////////////////////////////////////////////////////////////
34+
#pragma mark - NSURLRequest+CustomHTTPBody
35+
36+
@interface NSURLRequest (CustomHTTPBody)
37+
/**
38+
* Unfortunately, when sending POST requests (with a body) using NSURLSession,
39+
* by the time the request arrives at OHHTTPStubs, the HTTPBody of the
40+
* NSURLRequest has been reset to nil.
41+
*
42+
* You can use this method to retrieve the HTTPBody for testing and use it to
43+
* conditionally stub your requests.
44+
*/
45+
- (NSData *)OHHTTPStubs_HTTPBody;
46+
@end
47+
48+
#endif /* __IPHONE_7_0 || __MAC_10_9 */

0 commit comments

Comments
 (0)