web_util_set_request_url

Sets a string to be the request URL for the next request sent in the ConversationClosed An Asynchronous Conversation is a series of related web tasks, including tasks caused by redirection. An Asynchronous Conversation starts with the request for the desired response, includes all the requests and responses that are caused by this request (authentication, redirection, and so on) and ends when the desired response is received or when the series of interactions is canceled..

int web_util_set_request_url ( const char * aUrlStr);
Argument Description
aUrlStr

The string to be set as the absolute URL for the new request. For example, http://www.site.com/bin/cgi.exe?a=b

Do not pass a URL-encoded string.

Return Values

This function returns LR_PASS (0) on success, and LR_FAIL (1) on failure.

Parameterization

All input arguments can be parameterized using standard parameterization.

General Information

This is a utility function that can be called from callback routine Request Callback.

The string is encoded for the URL, and passed with spaces and special characters. If you pass a URL-encoded string, it may be unusable after the encoding is applied to an already encoded string.

Example

The following example illustrates an asynchronous conversation.
/* Added by Async CodeGen.
ID = Push_0
ScanType = Recording

The following URLs are considered part of this conversation:
	http://push.myStream.com/myStream/STREAMING_IN_PROGRESS?LS_session=123456789ABCDE&LS_phase=2903&LS_domain=myStream.com&

TODO - The following callbacks have been added to AsyncCallbacks.c.
Add your code to the callback implementations as necessary.
	Push_0_RequestCB
	Push_0_ResponseBodyBufferCB
	Push_0_ResponseHeadersCB
	Push_0_ResponseCB
 */
	web_reg_async_attributes("ID=Push_0",
		"Pattern=Push",
		"URL=http://push.myStream.com/myStream/STREAMING_IN_PROGRESS?LS_session=123456789ABCDE&LS_phase=2903&LS_domain=myStream.com&",
		"RequestCB=Push_0_RequestCB",
		"ResponseHeadersCB=Push_0_ResponseHeadersCB",
		"ResponseBodyBufferCB=Push_0_ResponseBodyBufferCB",
		"ResponseCB=Push_0_ResponseCB",
		LAST);

/* Added by Async CodeGen.
ID = Push_0
 */
	web_stop_async("ID=Push_0",
		LAST);

//Automatically generated file for implementing async callback functions.
//You may modify the added callback implementations or add new ones.
//Async callback functions may be registered in web_reg_async_attributes steps.
int Push_0_RequestCB()
{
	//enter your implementation for RequestCB() here

	//call web_util_request_set_url() here to modify request url:
	web_util_set_request_url("<request url>");

	//call web_util_set_request_body() here to modify request body:
	web_util_set_request_body("<request body>");
	//call web_util_set_request_header() here to set request header:
	web_util_set_request_header("<header_name>", "<header_value>");

	return WEB_ASYNC_CB_RC_OK;
}

int Push_0_ResponseHeadersCB(
	int		aHttpStatusCode,
	const char *	aAccumulatedHeadersStr,
	int		aAccumulatedHeadersLen)
{
	//Enter your implementation for ResponseHeadersCB() here.

	return WEB_ASYNC_CB_RC_OK;
}

int Push_0_ResponseBodyBufferCB(
	const char *    aLastBufferStr,
	int             aLastBufferLen,
	const char *    aAccumulatedStr,
	int             aHttpStatusCode)
{
	//enter your implementation for ResponseBodyBufferCB() here

	return WEB_ASYNC_CB_RC_OK;
}

int Push_0_ResponseCB(
	const char *    aResponseHeadersStr,
	int             aResponseHeadersLen,
	const char *    aResponseBodyStr,
	int             aResponseBodyLen,
	int             aHttpStatusCode)
{
	//enter your implementation for ResponseCB() here

	return WEB_ASYNC_CB_RC_OK;
}