|
Rank: Member Groups: Member
Joined: 11/13/2015 Posts: 29
|
Hello, Is it possible to do a WebView.LoadRequest (or any other method) providing raw POST data rather than a key-value collection? How would I do that?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi,
Have you tried to use Request.PostData.Add(new PostDataItem(raw_data))?
Thanks!
|
|
Rank: Member Groups: Member
Joined: 11/13/2015 Posts: 29
|
eo_support wrote:Hi,
Have you tried to use Request.PostData.Add(new PostDataItem(raw_data))?
Thanks! That was exactly what I was looking for. Thanks! How would this work in case where I use both AddValue and Add(new PostDataItem(raw_data))? Can I assume the end result would just be a concatenation of the two?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi, Yes. They will be combined. When you use both AddValue and PostDataItem(raw_data), the first PostDataItem() with an empty data array will be used to hold values you added through AddValue (if there is none then a new one will be created). See the comments in the following code:
Code: C#
//Add a new PostDataItem with 5 bytes
request.PostData(new PostDataItem(new byte[5]{1, 2, 3, 4, 5});
//Here a second PostDataItem will be created and this
//second PostDataItem will be used to hold name value
//pairs
request.PostData.AddValue("test", "value");
//Now the two PostDataItem are sent to the browser engine, which
//will "flat" them into a single binary chunk
LoadRequest(...);
Hope this helps. Please feel free to let us know if you still have any more questions. Thanks!
|
|
Rank: Member Groups: Member
Joined: 11/13/2015 Posts: 29
|
Perfect. Thanks!
|
|