Skip to content

request: expose serialize postData #9

@postite

Description

@postite

i had the need for modifying the values of a form in a pushstate.prevent.

would you expose the serializing postdata function to make it easier ?

something like that ?:

 public function serializeStatePostData(state:Dynamic):Dynamic {
var buf:StringBuf=new StringBuf();
for (a in Reflect.fields(state)){
    var p:String=Reflect.field(state,a);
    var _a=a+"="+p.urlEncode();
    buf.add(_a+"&");
}

Reflect.setField(state,"__postData",buf.toString());
return state;

}

perhaps i'm not doing it right but i don't get why we couldn't do it by default.
thx

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions