Welcome Guest Search | Active Topics | Sign In | Register

EO.WebBrowser POST LoadRequest with raw POST data Options
Roei Ben-Harush
Posted: Friday, November 13, 2015 10:37:27 PM
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?
eo_support
Posted: Saturday, November 14, 2015 11:35:49 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,080
Hi,

Have you tried to use Request.PostData.Add(new PostDataItem(raw_data))?

Thanks!
Roei Ben-Harush
Posted: Monday, November 16, 2015 11:37:01 AM
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?
eo_support
Posted: Tuesday, November 17, 2015 10:53:29 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,080
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!
Roei Ben-Harush
Posted: Tuesday, November 17, 2015 11:50:22 AM
Rank: Member
Groups: Member

Joined: 11/13/2015
Posts: 29
Perfect. Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.