Namespace: OpenEdge.Net.HTTP.Filter.Payload
Type: Class FormDataEntityWriter
Parent Classes:
Inherits: OpenEdge.Net.HTTP.Filter.Payload.MessageWriter


Copyright (c) 2022 by Progress Software Corporation. All rights reserved.
File:FormDataEntityWriter
Purpose:Converts bytes/characters into a IStringStringMap
Author(s):pjudge
Created:2022-01-07
Notes:- This EntityWriter converts raw data from an HTTP message into
an instance of a IStringStringMap.
- An EntityWriter is used by the ABL HTTP client to convert body data
recieved from the remote server into an a 'strongly typed object',
that will become the HttpResponse's Entity.
- An EntityWriter can be used by a WebHandler to convert the request body
data into a 'strongly typed object', used by the WebRequest.
THe WebRequest's GetTypedEntity() method will do this conversion.



Method Summary
  Options Name Purpose
  AddField (character) /* Adds a form field to the intenal map. Field names and values are decoded before storing. If the field value passed in does not have an "=" character, then the whole value is used as the field name, and an empty/blank value. @param character A name=value 'field' */
  Open () /* If nothing's passed in, use a StringStringMap of our own. Don't do this in the constructor as a micro-optimisation (yes, I know) */
  INT64 Write (character) /* Writes character form data. Field names and values are decoded. @param memptr A memptr containing form data. It is the caller's responsibility to clean up the memptr @return int64 The number of bytes written */
  INT64 Write (longchar) /* Writes longchar form data. Field names and values are decoded. @param longchar Form data @return int64 The number of bytes written */
  INT64 Write (memptr) /* Writes form-data from a memptr. The first string in the memptr is passed to the Write(longchar) method; this may not be the entire memptr data. @param memptr A memptr containing form data. It is the caller's responsibility to clean up the memptr @return int64 The number of bytes written */
  INT64 Write (Object) /* Writes data that's assumed to be form-encoding. This method only accepts - IStringIStringMap: All entries are added to the current form data entity - ILongcharHolder, ICharacterHolder: calls the Write(longchar) method - OpenEdge.Core.Memptr, ByteBucket: calls the Write(memptr) method Field names and values are decoded. @param Object An object containing form data @return int64 The number of bytes written. */

Constructor Summary
  Options Name Purpose
  FormDataEntityWriter () /* Default constructor */

Method Detail
Top

AddField (character)

/* Adds a form field to the intenal map. Field names and values are decoded before storing.
If the field value passed in does not have an "=" character, then the whole value is used
as the field name, and an empty/blank value.
Parameters:
pFld CHARACTER
 
Top

Open ()

/* If nothing's passed in, use a StringStringMap of our own.
Don't do this in the constructor as a micro-optimisation (yes, I know)
Top

INT64 Write (character)

/* Writes character form data.
Field names and values are decoded.
Parameters:
pData CHARACTER
 
Returns INT64
  int64 The number of bytes written
Top

INT64 Write (longchar)

/* Writes longchar form data.
Field names and values are decoded.
Parameters:
pData LONGCHAR
 
Returns INT64
  int64 The number of bytes written
Top

INT64 Write (memptr)

/* Writes form-data from a memptr. The first string in the memptr is passed to the Write(longchar) method;
this may not be the entire memptr data.
Parameters:
pData OpenEdge.Core.Memptr
 
Returns INT64
  int64 The number of bytes written
Top

INT64 Write (Object)

/* Writes data that's assumed to be form-encoding.
This method only accepts
- IStringIStringMap: All entries are added to the current form data entity
- ILongcharHolder, ICharacterHolder: calls the Write(longchar) method
- OpenEdge.Core.Memptr, ByteBucket: calls the Write(memptr) method
Field names and values are decoded.
Parameters:
pData Progress.Lang.Object
 
Returns INT64
  int64 The number of bytes written.


Constructor Detail
Top

FormDataEntityWriter ()

/* Default constructor