Skip to content

Commit

Permalink
Merge pull request #127 from ndsev/fix-httplib-interface
Browse files Browse the repository at this point in the history
Fix httplib API calls for empty body #126
  • Loading branch information
fklebert authored Dec 13, 2024
2 parents cf7922a + a657185 commit 2c31269
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ jobs:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
runs-on: ubuntu-latest
container: ghcr.io/klebert-engineering/manylinux-cpp17-py${{ matrix.python-version }}-x86_64:2024.1
container: ghcr.io/klebert-engineering/manylinux-cpp17-py${{ matrix.python-version }}-x86_64:2024.2
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
steps:
- name: Which Node.js?
run: |
echo "Node at $(which node): $(node -v); npm: $(npm -v)"
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Configure
run: |
python3 -m venv venv && . ./venv/bin/activate
Expand All @@ -37,7 +37,7 @@ jobs:
. ../venv/bin/activate
ctest -C Release --verbose --no-tests=error
- name: Deploy
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: zswag-py${{ matrix.python-version }}-ubuntu-latest
path: build/bin/wheel/*.whl
Expand All @@ -48,7 +48,7 @@ jobs:
os: [macos-13, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Cache Conan packages
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
cmake "-DPython3_ROOT_DIR=$env:pythonLocation" -DPython3_FIND_REGISTRY=LAST -DCMAKE_BUILD_TYPE=Release -DZSWAG_ENABLE_TESTING=ON ..
cmake --build . --config Release
- name: Deploy
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: zswag-py${{ matrix.python-version }}-${{ matrix.os }}
path: build/bin/wheel/*.whl
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ project(zswag)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(ZSWAG_VERSION 1.7.0)
set(ZSWAG_VERSION 1.7.1)

option(ZSWAG_BUILD_WHEELS "Enable zswag whl-output to WHEEL_DEPLOY_DIRECTORY." ON)
option(ZSWAG_KEYCHAIN_SUPPORT "Enable zswag keychain support." ON)
Expand Down
18 changes: 9 additions & 9 deletions libs/httpcl/src/http-client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Result HttpLibHttpClient::get(const std::string& uriStr,
auto uri = URIComponents::fromStrRfc3986(uriStr);
return makeResult(
makeClientAndApplyQuery(uri, config, timeoutSecs_, sslCertStrict_)
->Get(uri.buildPath().c_str()));
->Get(uri.buildPath()));
}

Result HttpLibHttpClient::post(const std::string& uriStr,
Expand All @@ -75,9 +75,9 @@ Result HttpLibHttpClient::post(const std::string& uriStr,
return makeResult(
makeClientAndApplyQuery(uri, config, timeoutSecs_, sslCertStrict_)
->Post(
uri.buildPath().c_str(),
uri.buildPath(),
body ? body->body : std::string(),
body ? body->contentType.c_str() : nullptr));
body ? body->contentType : std::string()));
}

Result HttpLibHttpClient::put(const std::string& uriStr,
Expand All @@ -88,9 +88,9 @@ Result HttpLibHttpClient::put(const std::string& uriStr,
return makeResult(
makeClientAndApplyQuery(uri, config, timeoutSecs_, sslCertStrict_)
->Put(
uri.buildPath().c_str(),
uri.buildPath(),
body ? body->body : std::string(),
body ? body->contentType.c_str() : nullptr));
body ? body->contentType : std::string()));
}

Result HttpLibHttpClient::del(const std::string& uriStr,
Expand All @@ -101,9 +101,9 @@ Result HttpLibHttpClient::del(const std::string& uriStr,
return makeResult(
makeClientAndApplyQuery(uri, config, timeoutSecs_, sslCertStrict_)
->Delete(
uri.buildPath().c_str(),
uri.buildPath(),
body ? body->body : std::string(),
body ? body->contentType.c_str() : nullptr));
body ? body->contentType : std::string()));
}

Result HttpLibHttpClient::patch(const std::string& uriStr,
Expand All @@ -114,9 +114,9 @@ Result HttpLibHttpClient::patch(const std::string& uriStr,
return makeResult(
makeClientAndApplyQuery(uri, config, timeoutSecs_, sslCertStrict_)
->Patch(
uri.buildPath().c_str(),
uri.buildPath(),
body ? body->body : std::string(),
body ? body->contentType.c_str() : nullptr));
body ? body->contentType : std::string()));
}

Result MockHttpClient::get(const std::string& uri,
Expand Down

0 comments on commit 2c31269

Please sign in to comment.