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

HttpClient MakeRequest deprecated - any similar function ? #2802

Closed
tagopinath opened this issue Dec 28, 2023 · 3 comments
Closed

HttpClient MakeRequest deprecated - any similar function ? #2802

tagopinath opened this issue Dec 28, 2023 · 3 comments
Labels
guidance Question that needs advice or information.

Comments

@tagopinath
Copy link

Describe the bug

Hello,

When i am trying to call MakeRequest from HttpClient, its showing the error like,

error C2027: use of undefined type 'Aws::Http::HttpClient'
note: see declaration of 'Aws::Http::HttpClient'
error C2039: 'MakeRequest': is not a member of 'std::shared_ptrAws::Http::HttpClient'

Here is the code i am using

std::shared_ptrAws::Http::HttpClient myclient = Aws::Http::CreateHttpClient(clientConfig);

Aws::Http::URI url("some path);
std::shared_ptrAws::Http::HttpRequest req(Aws::Http::CreateHttpRequest(url, Aws::Http::HttpMethod::HTTP_POST, Aws::Utils::Stream::DefaultResponseStreamFactoryMethod));

std::shared_ptrAws::IOStream body = Aws::MakeSharedAws::StringStream(extParam.c_str());
req->AddContentBody(body);
std::shared_ptrAws::Http::HttpResponse res = myclient->MakeRequest(*req); // getting error here
Aws::Http::HttpResponseCode resCode = res->GetResponseCode();

Is there any other way to send request to retrieve the results ?

Regards,
Gopinath.

Expected Behavior

compile

Current Behavior

showing error

Reproduction Steps

no special steps

Possible Solution

No response

Additional Information/Context

No response

AWS CPP SDK version used

1.6.2

Compiler and Version used

visual studio 2015

Operating System and version

windows 10

@tagopinath tagopinath added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Dec 28, 2023
@sbiscigl
Copy link
Contributor

Why are you trying to invoke the http client directly? This is most likely a anti pattern and you should not be doing this, but lets see if we can point you in the right direction.

Are you trying to make a http request to a non aws service?

if yes, you likely should be using the underlying http client to do such. if on windows as you mention you could use the win http client which the SDK uses under the hood. Alternatively you could install and use easy_curl/libcurl or curl for people

Are your trying to make a request to a aws service?

if yes, then why are you not using the higher level client?

depending one which category you fall in we can discuss what you should do next.

Thats aside

AWS CPP SDK version used
1.6.2

thats is a very old version and no more updates will be added to the 1.6 tag. if you dont update your version to HEAD you will be missing some very important changes. any reason you are not using HEAD? if you update your version the code you have mentioned in the ticket will work, although I would recommend against using the http client directly.

@sbiscigl sbiscigl added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days. and removed bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Dec 28, 2023
@jmklix jmklix added the guidance Question that needs advice or information. label Dec 28, 2023
@tagopinath
Copy link
Author

Thank you,

Will try with libcurl, that is enough for my task.

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days. label Dec 30, 2023
@sbiscigl sbiscigl closed this as completed Jan 2, 2024
Copy link

github-actions bot commented Jan 2, 2024

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
guidance Question that needs advice or information.
Projects
None yet
Development

No branches or pull requests

3 participants