How do I submit a PDF form using HTML export format?

Q: I have a quick query that I'm struggling to find the solution to.

I have created a button on a form, and set its 'DOWN' action to submit
the form data to a given url. I am aware that it is possible to set
the ExportFormat flags (?) so that the data is sent in HTML format,
but I cannot find an example of how to do this. The PDF spec is not
very clear in this regard - at least, not the section I've been
looking at!

The pdftron example code has been extremely helpful, but does not
include this particular scenario.

My code is below:

FileSpec url = FileSpec.CreateURL(pdfDoc, "http://server2-");
Action button_action = Action.CreateSubmitForm(url);
//set to HTML ???
Obj ba = button_action.GetSDFObj();
// ba.PutNumber("ExportFormat",3);
// Associate the above action with 'Down' event in annotations action
Obj annot_action = newAnnot.GetSDFObj();
Obj aa_dict = annot_action.PutDict("AA");
aa_dict.Put("D", ba);

Could you point me in the right direction?
A: You were on the right track, the only problem is that ExportFormat
is supposed to be 8 (2^3 - i.e. a third bit) instead of 3.

int flags = 4; // bit pos 3
ba.PutNumber("ExportFormat", flags);

Another possibly usefully flag is:

Bit pos 4 - GetMethod - If set, field names and values are submitted
using an HTTP GET request. If clear, they are submitted using a POST
request. This flag is meaningful only when the ExportFormat flag is
set; if ExportFormat
is clear, this flag must also be clear.

Bit pos 3 - ExportFormat - Meaningful only if the SubmitPDF and XFDF
flags are clear. If set, field names and values are submitted in HTML
Form format. If clear, they are submitted in Forms Data Format (FDF);
see Section 8.6.6, "Forms Data Format."

int flags = 4 + 8; // to select both GetMethod and ExportFormat flag.
ba.PutNumber("ExportFormat", flags);