Skip to content
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

Change in getProviderCount function from comment https://github.com/telefonicaid/fiware-orion/pull/4275#discussion_r1195415590 #4348

Open
Anjali-NEC opened this issue May 31, 2023 · 2 comments

Comments

@Anjali-NEC
Copy link
Contributor

Anjali-NEC commented May 31, 2023

@fgalan

From comment #4275 (comment)

Btw, this function is somehow a "hack" to get the value of a given header but maybe a more general solution would be to process all the headers in the response (in a std:map, for instance) so we can easily access to the fiware-total-count header just doing something like reponseHeaders["fiware-total-count"].

In the same sense we have a function to get the response payload (I think is jsonPayloadClean()) we should have some responseHeaders() function for that. However, this can be deferred to a next PR, no need to include that in this (except if you think is easy and you want to do it :)

As per your suggestion we need to change the function to get the response in the form of map to easily access fiware-total-count.

Currently CPr response is received in "out" parameter that is a std::string type variable. I am facing issue while converting the out response into map variable. As per my understanding we need to do lots of code change to convert the string data into map by separating the keys and values from out string.

Could you please elaborate your suggestion or help us to get the response?
Thanks

@fgalan
Copy link
Member

fgalan commented May 31, 2023

Not sure if now is the right moment to implement this issue...

I mean, although it would be smarter implementing a mechanism as I suggest (processing the response payload to grab all the HTTP headers in it and put these header in a std::map which key is the header name and which value is the header value) maybe it doesn't worth the effort if the only header we are going to process is fiware-total-count (which processing logic, although it not the smartest way, is already implemented in PR #4275).

Maybe the moment to implement this issue is when we need another header different from fiware-total-count from response. If that moment never occur :) then maybe this issue is not needed.

In my opinion, by the moment the wiser option is to wait. I'd suggest you to choose another issue (look specially for the help wanted ones).

Thanks for your willingness to contribute to Orion Context Broker!

@Anjali-NEC
Copy link
Contributor Author

Anjali-NEC commented Jun 1, 2023

Yes, I have also the same understanding. As per your suggestion we have stopped working on this issue because currently the processing of only one header is required. We will work on this in future whenever multiple header processing will be required.

Based on the discussion on this issue we are requesting you to mark comment on #4275 (comment) as 'NTC', for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants