1- // Licensed to the Apache Software Foundation (ASF) under one
2- // or more contributor license agreements. See the NOTICE file
3- // distributed with this work for additional information
4- // regarding copyright ownership. The ASF licenses this file
5- // to you under the Apache License, Version 2.0 (the
6- // "License"); you may not use this file except in compliance
7- // with the License. You may obtain a copy of the License at
8- //
9- // http://www.apache.org/licenses/LICENSE-2.0
10- //
11- // Unless required by applicable law or agreed to in writing,
12- // software distributed under the License is distributed on an
13- // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14- // KIND, either express or implied. See the License for the
15- // specific language governing permissions and limitations
16- // under the License.
1+ // In file: iceberg/catalog/rest/rest_catalog.cc
172
183#include " iceberg/catalog/rest/rest_catalog.h"
194
20- #include < iostream>
21-
225#include < cpr/cpr.h>
236
247namespace iceberg {
@@ -27,26 +10,12 @@ namespace rest {
2710
2811RestCatalog::RestCatalog (const std::string& base_url) : base_url_(std::move(base_url)) {}
2912
30- void RestCatalog::testCprIntegration () {
31- std::cout << " Testing CPR integration with base URL: " << base_url_ << std::endl;
32-
13+ cpr::Response RestCatalog::testCprIntegration () {
3314 // Simple GET request demo
3415 cpr::Response r =
3516 cpr::Get (cpr::Url{" https://httpbin.org/get" }, cpr::Parameters{{" hello" , " world" }});
3617
37- std::cout << " Status code: " << r.status_code << std::endl;
38- std::cout << " Content-Type: " << r.header [" content-type" ] << std::endl;
39- std::cout << " Response text (first 200 chars): "
40- << r.text .substr (0 , std::min<size_t >(200 , r.text .size ())) << " ..."
41- << std::endl;
42-
43- // Simulated REST catalog API request
44- std::string catalog_url = base_url_ + " /v1/namespaces" ;
45- std::cout << " \n Simulated catalog request to: " << catalog_url << std::endl;
46-
47- // In real implementation, this would be:
48- // cpr::Response catalog_r = cpr::Get(cpr::Url{catalog_url},
49- // cpr::Header{{"Content-Type", "application/json"}});
18+ return r;
5019}
5120
5221} // namespace rest
0 commit comments