Sophie

Sophie

distrib > Mandriva > 2010.1 > i586 > media > contrib-updates > by-pkgid > a65e18d6cd6ada0b594b5264b3e30c20 > files > 14

qoauth-devel-1.0.1-2.1mdv2010.1.i586.rpm

QByteArray url( "http://example.com/get_photo" );
// create a request parameters map
QOAuth::ParamMap map;
map.insert( "file", "flower_48.jpg" );
map.insert( "size", "small" );

// construct the authorization header
QByteArray header =
    qoauth->createParametersString( requestUrl, QOAuth::GET, QOAuth::HMAC_SHA1,
                                    token, tokenSecret, map,
                                    QOAuth::ParseForHeaderArguments );
// append parameters string to the URL
// alternatively you can use QOAuth::ParseForRequestContent if you want
// to use the output as a POST request content (remember then of passing
// QOAuth::POST above).
url.append( qoauth->inlineParameters( map, QOAuth::ParseForInlineQuery ) );
QNetworkRequest request( QUrl( url ) );
request.setRawHeader( "Authorization", header );
// etc...