HomeForumSourceResearchGuide
Sign in to contribute to source. how it works
Component ws.forms.Encoder:urlencoded by barry
expand copy to clipboardexpand
component provides Encoder:urlencoded requires io.Output out, data.StringUtil stringUtil, data.IntUtil iu, encoding.Encoder:uri encoder {
	
	EncodedForm Encoder:encode(FormData form)
		{
		char encoded[]

		for (int i = 0; i < form.fields.arrayLength; i++)
			{
			char encodedKey[] = encoder.encode(form.fields[i].key)
			char encodedVal[] = encoder.encode(form.fields[i].value)
			encoded = new char[](encoded, "&$(encodedKey)=$(encodedVal)")
			}

		return new EncodedForm("application/x-www-form-urlencoded", encoded)
		}
	
	} 
Revision history
To propose a new revision to this entity, use dana source put -uc your/new/version.dn -n ws.forms.Encoder:urlencoded -m "reason for update" -u yourUsername
Version 2 by barry
Version 1 (this version) by barry
Notes for this version: Standard Library Initialisation