Languages

Menu
Sites
Language
Multiple HttpRequest

Hi

I want to use multiple http request in same time.

 

I'm creating HTTP REST Request and response.

 

 I get response message in OnTransactionReadyToRead function 

void
HttpForm::OnTransactionReadyToRead(HttpSession& httpSession, HttpTransaction& httpTransaction, int availableBodyLen)
{
    //Called to notify when the content body of the response has been received.
	AppLog("OnTransactionReadyToRead");



	HttpResponse* pHttpResponse = httpTransaction.GetResponse();

	HttpHeader* pHttpHeader = pHttpResponse->GetHeader();

			if (pHttpHeader != null)
			{

				 ByteBuffer* pBody = null;
				 String statusText = pHttpResponse->GetStatusText();
				 String version = pHttpResponse->GetVersion();
				 pBody = pHttpResponse->ReadBodyN();


				String encodedStr((const char*)(pBody->GetPointer()));

				 __pBusNum->SetText(encodedStr);
				 __pBusNum->Invalidate(false);


	

				 delete pBody;


				String* tempHeaderString = pHttpHeader->GetRawHeaderN();
				ByteBuffer* pBuffer = pHttpResponse->ReadBodyN();

				String text(L"Read Body Length: ");
				text.Append(availableBodyLen);

		
				Draw();

				delete tempHeaderString;
				delete pBuffer;

			} else if(pHttpHeader == null) {
				AppLog("pHttpHeader is NULL");
			}



	
}

 

1. This code just has 1 http request. But, I think to get message "Transaction is being processed" when I use multiple requests.

    Can I use multiple request ?

 

2. How can I distribute kind of response ? switch and case ? or xml parsing ?

 

 

Please let me know,

Thanks.

 

Best Regards,

Jenny

 

 

Edited by: Jenny Blossoms on 28 Nov, 2013

Responses

1 Replies
Pushpa G

I guess yes you can make multiple requests, check Tizen IDE>Help>Help contents>Tizen Native App Programming > Programming Guide > Net: Managing Network Connections and Communication > HTTP Connectivity>HTTP Transaction