Skip to content

Using PutObject with stdin (eg passing std::cin to request.SetBody(). #3072

Answered by jmklix
RobertPHeller asked this question in Q&A
Discussion options

You must be logged in to vote

You can set a StringStream with the input that you want to use and then pass that to SetBody(). Here is a code snippet that I got working to show you how to do this:

        std::shared_ptr<Aws::IOStream> inputData = Aws::MakeShared<Aws::StringStream>("allocTag");
        Aws::String sTemp;
        std::getline(std::cin, sTemp);
        *inputData << sTemp;
        request.SetBody(inputData);

Let me know if you have any more questions about how to use this sdk.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jmklix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants