doPutEx
Executes an HTTP request using the PUT method specifying the data stream and having the MIME type set automatically.
Format 1
void doPutEx( strUrl, content ) |
Format 2
void doPutEx( strUrl, type, content ) |
Format 3
void doPutEx( strUrl, type, content, hasDummyRoot ) |
Syntax rules
1. strUrl is the URL to invoke.
2. content contains the data stream.
3. type is the MIME type (i.e. "text/xml")
4. hasDummyRoot is an alphanumeric data item or literal hosting a boolean value (e.g. "0", "1", "true", "false", "yes", "no", "on" or "off"). If the boolean value is TRUE, then the top level item of Record-Definition is discarded and will not appear in the JSON stream . This parameter can be NULL, in such case, FALSE is assumed.
General rules
1. In Format 1,
type is set to "application/json" or "application/xml" depending on the Content-type request header field. If no Content-type field is available in the request header, then the type is controlled by the
iscobol.rest.default_stream configuration setting.
2. If content is an appropriately structured variable with external names and the type is set to "application/json", the method makes a request using the JSON format.
3. If content is an appropriately structured variable with external names but type is not set to "application/json", the method makes a request using the XML format.
Example
Issue a PUT request with parameters:
... configuration section. repository. class http-client as "com.iscobol.rts.HTTPClient" ... working-storage section. 77 http object reference http-client. 01 request identified by "newdata". 03 identified by "mail". 05 mail pic x any length. ... procedure division. ... move "newaddress@mail.com" to mail. http:>doPutEx("http://example.com/users/user1", request). ... |