diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebKit2/Shared/API/c/WKURLRequest.cpp | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
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); |