mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-04 10:22:55 +00:00
05345ee28c
Conflicts: CefSharp.WinFormsExample/Browser.cs CefSharp/CefFormsWebBrowser.cpp CefSharp/CefFormsWebBrowser.h CefSharp/CefSharp.cpp CefSharp/CefWpfWebBrowser.cpp CefSharp/CefWpfWebBrowser.h CefSharp/ManagedCefRefPtr.h CefSharp/OffscreenClientAdapter.h CefSharp/ReadMe.txt CefSharp/ScriptException.h CefSharp/app.rc include/cef.h include/internal/cef_types_win.h
60 lines
1.4 KiB
C++
60 lines
1.4 KiB
C++
#include "stdafx.h"
|
|
|
|
#include "Request.h"
|
|
|
|
namespace CefSharp
|
|
{
|
|
|
|
String^ CefRequestWrapper::Url::get()
|
|
{
|
|
return toClr(_wrappedRequest->GetURL());
|
|
}
|
|
|
|
void CefRequestWrapper::Url::set(String^ url)
|
|
{
|
|
if(url == nullptr)
|
|
{
|
|
throw gcnew System::ArgumentException("cannot be null", "url");
|
|
}
|
|
|
|
CefString str = toNative(url);
|
|
_wrappedRequest->SetURL(str);
|
|
}
|
|
|
|
String^ CefRequestWrapper::Method::get()
|
|
{
|
|
return toClr(_wrappedRequest->GetMethod());
|
|
}
|
|
|
|
IDictionary<String^, String^>^ CefRequestWrapper::GetHeaders()
|
|
{
|
|
CefRequest::HeaderMap hm;
|
|
_wrappedRequest->GetHeaderMap(hm);
|
|
|
|
IDictionary<String^, String^>^ headers = gcnew Dictionary<String^, String^>();
|
|
|
|
for (CefRequest::HeaderMap::iterator it = hm.begin(); it != hm.end(); ++it)
|
|
{
|
|
String^ name = toClr(it->first);
|
|
String^ value = toClr(it->second);
|
|
headers->Add(name, value);
|
|
}
|
|
|
|
return headers;
|
|
}
|
|
|
|
|
|
void CefRequestWrapper::SetHeaders(IDictionary<String^, String^>^ headers)
|
|
{
|
|
CefRequest::HeaderMap hm;
|
|
|
|
for each(KeyValuePair<String^, String^>^ pair in headers)
|
|
{
|
|
CefString name = toNative(pair->Key);
|
|
CefString value = toNative(pair->Value);
|
|
hm.insert(std::make_pair(name, value));
|
|
}
|
|
|
|
_wrappedRequest->SetHeaderMap(hm);
|
|
}
|
|
} |