Danijel,
Hope your holiday is going well - lots of sunscreen and cocktails being consumed.
Thanks for your help on my OAuth issues. I now have a strange issue in that I have to construct an OAuth header part based upon an XML that I sent in the body of the HTTP transmission.
To construct and transmit I am doing the following in the BeginRequest of the TRtcDataRequest:
lv_SL := TStringList.Create;
{Simplified version}
lv_SL.Add('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>');
lv_SL.Add('<ShoppingCartRequest>');
lv_SL.Add(' <OAuthToken>' + lv_CartOAuthToken + '</OAuthToken>');
lv_SL.Add(' <ShoppingCart>' { } );
lv_SL.Add(' <CurrencyCode>' + lv_CartCurrencyCode + '</CurrencyCode>');
lv_SL.Add(' <Subtotal>' + lv_CartSubTotal + '</Subtotal>');
lv_SL.Add(' </ShoppingCart>');
lv_SL.Add('</ShoppingCartRequest>');
with TRtcDataClient(Sender) do
begin
Request.ContentType := 'text/xml';
Request.Host := ServerAddr;
s := 'oauth_signature="' + URL_EncodeAll(lv_Oauth_BS_Sig) + '"';
s := s + ',oauth_body_hash="' + URL_EncodeAll(lv_oauth_body_hash) + '"';
s := s + ',oauth_version="1.0"';
s := s + ',oauth_nonce="' + URL_EncodeAll(lv_Nonce) + '"';
s := s + ',oauth_signature_method="RSA-SHA1"';
s := s + ',oauth_consumer_key="' + URL_EncodeAll(gv_oauth_consumer_key) + '"';
s := s + ',oauth_timestamp="' + lv_TS + '"';
Request['Authorization'] := 'OAuth ' + s;
Request.ContentType := 'application/xml';
Write(lv_SL.Text);
Flush;
end;
My question: am I assigning the body content type correctly and am I assigning and delivering the body itself correctly?
Reason I ask the question is that I am receiving error "The oauth_body_hash parameter does not match body contents and is invalid."
I know the OAuth part is correct because I an getting exact same values from the Java sample app.
Regards
Zane