Set REQUEST_METHOD to POSTRSS

1 reply

Last post Sep 17, 2020 09:10 AM by Jalpa Panchal

  • Set REQUEST_METHOD to POST

    Sep 16, 2020 06:59 AM|ultrAslan-fdb|LINK

    Hi everyone,

    I made a rule to change all incoming PUT-requests into POST-requests.

    Unfortunately nothing happens to the REQUEST_METHOD, it still remains a PUT.

    My rule looks as follows:

    <rule name="SetPost" stopProcessing="false">
       <match url=".*" />
       <conditions logicalGrouping="MatchAll" trackAllCaptures="true">
          <add input="{REQUEST_METHOD}" pattern="^PUT$" />
       </conditions>
       <serverVariables>
          <set name="{REQUEST_METHOD}" value="POST" />
       </serverVariables>
       <action type="Rewrite" url="{R:0}" logRewrittenUrl="true" />
    </rule>

    I also tried it with HTTP_METHOD or a Rewrite Map and got the same solution.

    I mean, it's not that complex so I don't get, what I'm doing wrong.

    Is there any other possibility to change an incoming PUT-request into a POST-request?

    Thanks in advance.

  • Re: Set REQUEST_METHOD to POST

    Sep 17, 2020 09:10 AM|Jalpa Panchal|LINK

    Hi,

    In my opinion, we can not change the request method using the URL rewrite. it is not possible. you have to change in code.

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue.
    If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.