PostData Property

The data to post with the URL if the POST method is used.

Syntax

ANSI (Cross Platform)
int GetPostData(char* &lpPostData, int &lenPostData);
int SetPostData(const char* lpPostData, int lenPostData); Unicode (Windows) INT GetPostData(LPSTR &lpPostData, INT &lenPostData);
INT SetPostData(LPCSTR lpPostData, INT lenPostData);
@property (nonatomic,readwrite,assign,getter=postData,setter=setPostData:) NSString* postData;
- (NSString*)postData;
- (void)setPostData:(NSString*)newPostData;

@property (nonatomic,readwrite,assign,getter=postDataB,setter=setPostDataB:) NSData* postDataB; - (NSData*)postDataB; - (void)setPostDataB:(NSData*)newPostData;
#define PID_REST_POSTDATA 35

IPWORKS_EXTERNAL void* IPWORKS_CALL IPWorks_REST_Get(void *lpObj, int propid, int arridx, int *lpcbVal, int64 *lpllVal);
IPWORKS_EXTERNAL int IPWORKS_CALL IPWorks_REST_Set(void *lpObj, int propid, int arridx, const void *val, int cbVal);

Default Value

""

Remarks

This property contains the data to post with the URL if the POST method is used. If this property contains a non-empty string, then if the HTTP 'POST' method is used (Post method), the contents of this property are appended to the HTTP request after the HTTP headers.

An HTTP 'Content-Length' header is also added to the request. Its value is the length of the string in PostData.

The most common example is posting of HTML form input data. In that case, the ContentType property must be set to "application/x-www-form-urlencoded".

Example (Performing a Post)


HTTPControl.ContentType = "application/x-www-form-urlencoded"
HTTPControl.PostData = "firstname=Tom&lastname=Thompson&country=US"
HTTPControl.Post(myurl)

This property is not available at design time.

Data Type

Binary String

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks 2020 C++ Edition - Version 20.0 [Build 8307]