You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
X-Rate-Limit and Retry-After is what I'm after, and possibly X-RateLimit-Remaning as well. That is all good as I can grab that information from restc-cpp in normal situations, but when too many rquests are sent the server replies like this:
HTTP/1.1 429 TOO MANY REQUESTS
Date: Sun, 16 Aug 2020 15:06:51 GMT
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: __cfduid=dcff530e7dd3ce21af4b75531708104ea1597590411; expires=Tue, 15-Sep-20 15:06:51 GMT; path=/; domain=.originsro.org; HttpOnly; SameSite=Lax
X-RateLimit-Limit: 6
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1597672569
Retry-After: 82157
CF-Cache-Status: DYNAMIC
cf-request-id: 0499682fa20000dc4b342a4200000001
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Server: cloudflare
CF-RAY: 5c3c0fc5d8d3dc4b-LHR
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>429 Too Many Requests</title>
<h1>Too Many Requests</h1>
<p>6 per 1 day</p>
Which results in a c++ exception. I still need the data from the header to pause my program's timer for the correct amount of time, however restc-cpp throws with this backtrace:
#0 0x00007ffff7814a70 in __cxa_throw () from /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/libstdc++.so.6
#1 0x00007ffff7eeaf06 in restc_cpp::RequestImpl::ValidateReply (this=0x7ffff0010f00, reply=...) at ../../../code/cpp/orotool/subprojects/restc-cpp/restc-cpp/src/RequestImpl.cpp:204
#2 0x00007ffff7eed2a6 in restc_cpp::RequestImpl::GetReply (this=0x7ffff0010f00, ctx=...) at ../../../code/cpp/orotool/subprojects/restc-cpp/restc-cpp/src/RequestImpl.cpp:484
#3 0x00007ffff7eed434 in restc_cpp::RequestImpl::DoExecute (this=0x7ffff0010f00, ctx=...) at ../../../code/cpp/orotool/subprojects/restc-cpp/restc-cpp/src/RequestImpl.cpp:498
#4 0x00007ffff7eeaa54 in restc_cpp::RequestImpl::Execute (this=0x7ffff0010f00, ctx=...) at ../../../code/cpp/orotool/subprojects/restc-cpp/restc-cpp/src/RequestImpl.cpp:146
#5 0x000055555560e70a in restc_cpp::RequestBuilder::Execute (this=0x7ffff0010690) at ../../../code/cpp/orotool/subprojects/restc-cpp/restc-cpp/include/restc-cpp/RequestBuilder.h:381
#6 0x0000555555603dae in oro::(anonymous namespace)::<lambda(restc_cpp::Context&)>::operator()(restc_cpp::Context &) const (this=0x7fffdc000e20, ctx=...)
at ../../../code/cpp/orotool/src/oro/api.cpp:151
and, in case it's useful, you can see here api.cpp:151.
Is there any way I can retrieve the header info I'm looking for when the server replies with an error?
The text was updated successfully, but these errors were encountered:
Merging recent changes to master.
All tests are passing under Debian and Ubuntu.
Issue #101 is reproducible under Windows.
Working on issue #101, #102, #104, #105
The server I'm connecting to only accept a limited number of requests per day. The response header contains this information, like this:
X-Rate-Limit
andRetry-After
is what I'm after, and possiblyX-RateLimit-Remaning
as well. That is all good as I can grab that information from restc-cpp in normal situations, but when too many rquests are sent the server replies like this:Which results in a c++ exception. I still need the data from the header to pause my program's timer for the correct amount of time, however restc-cpp throws with this backtrace:
and, in case it's useful, you can see here api.cpp:151.
Is there any way I can retrieve the header info I'm looking for when the server replies with an error?
The text was updated successfully, but these errors were encountered: