Posts data to a URL, and receives notification of the result.
#include <npapi.h> NPError NPN_PostURLNotify(NPP instance, const char* url, const char* target, uint32 len, const char* buf, NPBool file, void* notifyData);
The function has the following parameters:
- Current plug-in instance, specified by the plug-in.
- URL of the POST request, specified by the plug-in.
- Target window, specified by the plug-in. For values, see NPN_GetURL.
- Length of the buffer buf.
- Path to local temporary file or data buffer that contains the data to post.
Whether to post a file. Values:
- true: Post the local file whose path is specified in buf, then delete the file.
- false: Post the raw data in buf.
- Plug-in-private value for associating the request with the subsequent NPP_URLNotify call, which returns this value (see Description below).
- If successful, the function returns NPERR_NO_ERROR.
- If unsuccessful, the plug-in is not loaded and the function returns an error code. For possible values, see Error Codes.
NPN_PostURLNotify functions identically to NPN_PostURL, with these exceptions:
NPN_PostURLNotifysupports specifying headers when posting a memory buffer.
NPN_PostURLNotifycalls NPP_URLNotify upon successful or unsuccessful completion of the request. For more information, see NPN_PostURL.
NPN_PostURLNotify is typically asynchronous: it returns immediately and only later handles the request and calls NPP_URLNotify.
If this function is called with a target parameter value of _self or a parent to _self, this function should return an INVALID_PARAM NPError. This is the only way to notify the plug-in once it is deleted. See NPN_GetURL for information about this parameter.