src/HTTPHandler.h
branchv_0
changeset 25 dbeae485a3fd
parent 23 33f8162a4971
child 27 b679797949e9
equal deleted inserted replaced
24:4f96098f7c57 25:dbeae485a3fd
   210 		auto attributeName = currentReaderMetadata[currentAttributeIndex].getAttributeName();
   210 		auto attributeName = currentReaderMetadata[currentAttributeIndex].getAttributeName();
   211 
   211 
   212 		if (attributeName == L"id") requestId = value;
   212 		if (attributeName == L"id") requestId = value;
   213 		else if (attributeName == L"url") request.url = convertor.to_bytes(value);
   213 		else if (attributeName == L"url") request.url = convertor.to_bytes(value);
   214 		else if (attributeName == L"method") request.method = parseMethod(value);
   214 		else if (attributeName == L"method") request.method = parseMethod(value);
       
   215 		else if (attributeName == L"text") request.body = convertor.to_bytes(value);
       
   216 		else if (attributeName == L"data") request.body = "TODO: read binary data: " + convertor.to_bytes(value); // TODO: read hex/binary request body
   215 		else if (isHeaderAttribute(attributeName)) appendRequestHeader(fetchHeaderName(attributeName), value);
   217 		else if (isHeaderAttribute(attributeName)) appendRequestHeader(fetchHeaderName(attributeName), value);
   216 		else throw std::invalid_argument("Unsupported attribute in the header relation: " + convertor.to_bytes(attributeName + L" = " + value));
   218 		else throw std::invalid_argument("Unsupported attribute in the header relation: " + convertor.to_bytes(attributeName + L" = " + value));
   217 
   219 
   218 		currentAttributeIndex++;
   220 		currentAttributeIndex++;
   219 
   221