-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[cpp rest-sdk] Response headers handler #1511
[cpp rest-sdk] Response headers handler #1511
Conversation
modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/apiclient-header.mustache
Show resolved
Hide resolved
What about error status? no need for headers there? |
@etherealjoy If I understand your question(s), with the status code is not enough to get all the information some APIs send. As an example, the one I am using send information about remaining requests in the headers. |
@whoan
What I meant here if you want to invoke header handler callback when a 400 is received for example. |
@ethanjcohen Yes, I compiled the code. Before the last commit I hadn't done, but now I did and it is working fine. Regarding the status code, changing the handler signature to receive it would be a good improvement indeed. Do you want me to do it in this PR? |
@whoan |
@whoan thanks for the PR, which has been included in the v3.3.4 release: https://twitter.com/oas_generator/status/1068772409795207168 |
* Add support to set a Response headers handler * Update PetStore * Fix missing names * Update PetStore
PR checklist
./bin/
to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.sh
and./bin/security/{LANG}-petstore.sh
if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\
.master
,3.4.x
,4.0.x
. Default:master
.Description of the PR
Support processing the HTTP response headers through a handler that can be set in the
ApiClient
class.Some APIs (like this) return useful information in the response headers, so this PR is to support processing them.
Ping @ravinikam @stkrwork @fvarose @etherealjoy @MartinDelille