Send a POST request instead of Default GET

Not applicable

Hi,

I am looking to send a POST request in Apigee instead of the default GET.

I have used AssignMessage policy to set the <Verb> to POST. Is this the only way to achieve this or are there any cleaner means to achieve this?

0 4 3,367
4 REPLIES 4

Dear @apigee1234567 ,

You can make a POST request by setting a flow with Verb Post. See attached screenshots.

Clic on + icon next to default in Proxy EndPoints.

974-screen-shot-2015-08-18-at-62912-pm.png

973-screen-shot-2015-08-18-at-63026-pm.png

OR

Just change the Verb from GET to POST in flow condition.

    <Flows>
        <Flow name="hello">
            <Condition>(proxy.pathsuffix MatchesPath "/hello") and (request.verb = "POST")</Condition>
            <Description/>
            <Request/>
            <Response/>
        </Flow>
    </Flows>

976-screen-shot-2015-08-18-at-63337-pm.png

Cheers,

Anil Sagar

Hello @Anil Sagar

Thanks for the prompt reply. But adding a flow variable means changing the URL to include /hello at the end in the case described above.

If I do not want to change the URL and still send POST, is there a better way than using AssignMessage policy??

Dear @apigee1234567 ,

It's just an example. You can have same path to both GET & POST. Change the path to / to hit default end point.

Cheers,

Anil Sagar

@apigee1234567 , If above issue is resolved, Don't forget to hit "Accept" below the answer that fully addressed your question. It ensures that the next user with the same question will have the best answer at their fingertips.