Skip to content

Conversation

hg333
Copy link
Contributor

@hg333 hg333 commented Aug 29, 2021

Added a response constructor where content-type can be specified by the user
Usage

    CROW_ROUTE(app,"/test")([](){
        std::ostringstream os;
        os<<"<First>";
        os<<"<Content>";
        os<<"Element1";
        os<<"</Content>";
        os<<"<Content>";
        os<<"Element2";
        os<<"</Content>";
        os<<"<Content>";
            os<<"<InnerContent>";
            os<<"Element3";
            os<<"</InnerContent>";
        os<<"</Content>";
        os<<"</First>";
        
        return crow::response("xml",os.str());
    });

This PR aims to fix: #48

Copy link
Member

@The-EDev The-EDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your work, will merge as soon as CI is done

@The-EDev The-EDev merged commit 0a526f9 into CrowCpp:master Aug 29, 2021
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

Successfully merging this pull request may close these issues.

handler return automatically sets content-type
2 participants