iis - Can't PUT to my IHttpHandler, GET works fine -


i'm in process of writing ihttphandler. environment windows 7 enterprise, iis 7 (it appears). handler running application under default app pool running in integrated mode.

currently handler's processrequest() method following (just testing @ point):

public void processrequest(httpcontext context) {     context.response.statuscode = 200;     context.response.contenttype = "text/html";     context.response.output.write("file uploaded."); } 

i add handler via web.config follows:

<configuration>     <system.webserver>         <handlers>             <add name="httpupload" path="*" verb="*" type="httpupload, httpupload" resourcetype="unspecified"/>         </handlers>     </system.webserver> </configuration> 

i'm using curl test handler. when following:

curl http://localhost/httpupload/foo 

it works. however, when attempt put follows:

curl --upload-file build.txt http://localhost/httpupload/foo 

it fails 405, method not allowed, error. searched around , others on stackoverflow indicated webdavmodule needs removed. removed , did resolve 405 error. however, i'm getting 500.21 error. failed request tracing it's saying 'iis web core' module generating 500.21 error because 'the data invalid.' (8007000d). issue seems similar post:

iis 7, httphandler , http error 500.21

yet seemed fix others, eg running aspnet_regiis -i, had no impact me. debugged handler , breaks on handler's processrequest() method when using doesn't break on when using put know it's not getting called. reason other core module failing call.

edit:

i executed curl command against same url post , worked. , post work against http handler, put doesn't. executed same --upload-file curl command url on same box backed webdav , worked.

thanks, nick

well continued search around , while looking @ docs configuration saw following:

runmanagedmodulesforwebdavrequests

when reading following documentation:

https://www.iis.net/configreference/system.webserver/modules

i set true

<modules runmanagedmodulesforwebdavrequests="true"> 

and voila, put works http handler. guess once install webdav put's associated webdav? don't know, appears way. looks if have webdav installed need disable , set flag true.


Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -