diff --git a/README.md b/README.md index e5fa2c7..cf05f9d 100644 --- a/README.md +++ b/README.md @@ -61,8 +61,12 @@ rongcloud = RongCloud::Client.new( } ) -# Use the secondary parameter to override global HTTP options in -# a specific HTTP request. +# Use the global HTTP timeout options. +rongcloud.api.user.gettoken({ + userId: "nutzer", name: "John Doe" +}) + +# Override global HTTP timeout options in a specific HTTP request. rongcloud.api.user.gettoken({ userId: "nutzer", name: "John Doe" }, { diff --git a/spec/cassettes/RongCloud_Client/HTTP_options_on_specified_api/logging.yml b/spec/cassettes/RongCloud_Client/HTTP_options_on_specified_api/logging.yml new file mode 100644 index 0000000..93e2a3b --- /dev/null +++ b/spec/cassettes/RongCloud_Client/HTTP_options_on_specified_api/logging.yml @@ -0,0 +1,49 @@ +--- +http_interactions: +- request: + method: post + uri: https://api-cn.ronghub.com/user/getToken.json + body: + encoding: UTF-8 + string: userId=nutzer&name=John+Doe + headers: + Rc-App-Key: + - "" + Rc-Nonce: + - 3aKZFq9zJ5kUSYyp + Rc-Timestamp: + - '1697370397664' + Rc-Signature: + - c0f127edd81e7bbd1b99d36f63868b4122073744 + Connection: + - close + Content-Type: + - application/x-www-form-urlencoded + Host: + - api-cn.ronghub.com + User-Agent: + - http.rb/5.1.0 + response: + status: + code: 200 + message: OK + headers: + Content-Type: + - application/json;charset=UTF-8 + Transfer-Encoding: + - chunked + Connection: + - close + X-Request-Id: + - 2e539011-dd56-4c7c-a604-2679721e48fc + Date: + - Sun, 15 Oct 2023 11:46:37 GMT + Server: + - APISIX + X-Apisix-Upstream-Status: + - '200' + body: + encoding: UTF-8 + string: '{"code":200,"userId":"nutzer","token":"35Ufb55yCBsDTweUTPFMpEZVnOjSlpzryq8rYXuVAfk=@5r3v.cn.rongnav.com;5r3v.cn.rongcfg.com"}' + recorded_at: Sun, 15 Oct 2023 11:46:37 GMT +recorded_with: VCR 6.1.0 diff --git a/spec/rongcloud/client_spec.rb b/spec/rongcloud/client_spec.rb index 7e9c679..0d9d191 100644 --- a/spec/rongcloud/client_spec.rb +++ b/spec/rongcloud/client_spec.rb @@ -313,7 +313,7 @@ def make_request_id }.to raise_error(RongCloud::Exceptions::HttpError, /execution expired/) end - it "logging" do + it "logging", :vcr do strio = StringIO.new client = described_class.new( app_key: ENV["RONGCLOUD_APP_KEY"],