diff options
Diffstat (limited to 'Source/WebKit2/Shared/API/c/WKURLRequest.cpp')
-rw-r--r-- | Source/WebKit2/Shared/API/c/WKURLRequest.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Source/WebKit2/Shared/API/c/WKURLRequest.cpp b/Source/WebKit2/Shared/API/c/WKURLRequest.cpp index edbf219dc..736e1f3e6 100644 --- a/Source/WebKit2/Shared/API/c/WKURLRequest.cpp +++ b/Source/WebKit2/Shared/API/c/WKURLRequest.cpp @@ -28,6 +28,7 @@ #include "APIURLRequest.h" #include "WKAPICast.h" +#include "WKData.h" #include <WebCore/URL.h> using namespace WebCore; @@ -40,7 +41,7 @@ WKTypeID WKURLRequestGetTypeID() WKURLRequestRef WKURLRequestCreateWithWKURL(WKURLRef url) { - return toAPI(API::URLRequest::create(URL(URL(), toImpl(url)->string())).leakRef()); + return toAPI(&API::URLRequest::create(URL(URL(), toImpl(url)->string())).leakRef()); } WKURLRef WKURLRequestCopyURL(WKURLRequestRef requestRef) @@ -58,6 +59,13 @@ WKStringRef WKURLRequestCopyHTTPMethod(WKURLRequestRef requestRef) return toCopiedAPI(toImpl(requestRef)->resourceRequest().httpMethod()); } +WKURLRequestRef WKURLRequestCopySettingHTTPBody(WKURLRequestRef requestRef, WKDataRef body) +{ + WebCore::ResourceRequest requestCopy(toImpl(requestRef)->resourceRequest()); + requestCopy.setHTTPBody(FormData::create(WKDataGetBytes(body), WKDataGetSize(body))); + return toAPI(&API::URLRequest::create(requestCopy).leakRef()); +} + void WKURLRequestSetDefaultTimeoutInterval(double timeoutInterval) { API::URLRequest::setDefaultTimeoutInterval(timeoutInterval); |