author | Michael Krelin <hacker@klever.net> | 2008-03-07 19:53:46 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2008-03-07 19:53:46 (UTC) |
commit | f953b073abbf9e58e5b2a46c6ddf65f57dec1fad (patch) (unidiff) | |
tree | cd8bf29efc2dc59070c013a69a7c6d70f63322b4 | |
parent | 0d19bbaa23b7bd07ec4f5e3683ffdd8df4641bc9 (diff) | |
download | libopkele-f953b073abbf9e58e5b2a46c6ddf65f57dec1fad.zip libopkele-f953b073abbf9e58e5b2a46c6ddf65f57dec1fad.tar.gz libopkele-f953b073abbf9e58e5b2a46c6ddf65f57dec1fad.tar.bz2 |
comitting updated test consumer
Signed-off-by: Michael Krelin <hacker@klever.net>
-rw-r--r-- | test/test-oauth-consumer.cc | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/test/test-oauth-consumer.cc b/test/test-oauth-consumer.cc index 3b3ca70..c5a0fc0 100644 --- a/test/test-oauth-consumer.cc +++ b/test/test-oauth-consumer.cc | |||
@@ -41,26 +41,16 @@ int main(int,char**) { | |||
41 | sc.prepare_request(hr, | 41 | sc.prepare_request(hr, |
42 | opkele::fields_t(),test, | 42 | opkele::fields_t(),test, |
43 | opkele::oauth::oauth_auth_header,"HMAC-SHA1", | 43 | opkele::oauth::oauth_auth_header,"HMAC-SHA1", |
44 | &at,"realm"); | 44 | &at,"realm"); |
45 | DOUT_("url: " << hr.url << endl | 45 | CURLcode r = curl.misc_sets(); |
46 | << "body: " << hr.body << endl | 46 | r || (r=curl.set_write()); |
47 | << "header: " << hr.authorize_header); | ||
48 | opkele::util::curl_slist_t rh; | ||
49 | rh.append("Authorization: "+hr.authorize_header); | ||
50 | CURLcode r; | ||
51 | (r=curl.misc_sets()) | ||
52 | || (r=curl.set_write()) | ||
53 | || (r=curl.easy_setopt(CURLOPT_HTTPHEADER,rh) ) | ||
54 | || (r=curl.easy_setopt(CURLOPT_URL,hr.url.c_str())) | ||
55 | || (r=curl.easy_setopt(CURLOPT_POST,1)) | ||
56 | || (r=curl.easy_setopt(CURLOPT_POSTFIELDS,hr.body.c_str())) | ||
57 | || (r=curl.easy_setopt(CURLOPT_POSTFIELDSIZE,hr.body.size())); | ||
58 | if(r) | 47 | if(r) |
59 | throw opkele::exception_curl(OPKELE_CP_ "failed to set curly options",r); | 48 | throw opkele::exception_curl(OPKELE_CP_ "failed to set curly options",r); |
49 | hr.setup_curl(curl); | ||
60 | if( (r=curl.easy_perform()) ) | 50 | if( (r=curl.easy_perform()) ) |
61 | throw opkele::exception_curl(OPKELE_CP_ "failed to perform curly request",r); | 51 | throw opkele::exception_curl(OPKELE_CP_ "failed to perform curly request",r); |
62 | DOUT_("Response: " << endl << curl.response); | 52 | cout << "Response: " << curl.response << endl; |
63 | 53 | ||
64 | #ifdef OPKELE_HAVE_KONFORKA | 54 | #ifdef OPKELE_HAVE_KONFORKA |
65 | }catch(konforka::exception& e) { | 55 | }catch(konforka::exception& e) { |
66 | cerr | 56 | cerr |