405 - Method Not Allowed HttpWebRequest

前端 未结 3 827
萌比男神i
萌比男神i 2021-01-25 03:54

I have a problem when trying to send a POST request. The sending method looks like this:

Public Sub SendXML(ByVal file As String)
    Dim reader As          


        
3条回答
  •  不思量自难忘°
    2021-01-25 04:29

    There is nothing wrong with the POST request, so the problem must lie elsewhere.

    There are a number of other places along the way that could be causing trouble:

    1. There could be a bad proxy between you and the server that is changing the HTTP method
    2. The server could be malfunctioning or simply no support POST

    My guess, however, is that the server is doing more than just looking at the HTTP method and is instead giving you a 405 error in response to the RPC call that your XML payload is wrapping.

    Some RPC servers will (erroneously) use HTTP status codes like this to indicate that the requested method cannot be executed, or that something else is wrong with the request that is of a permissions and security nature.

    If the server is slightly better behaved (and you are lucky), it should be returning additional information in the response body that might indicate where the 405 error is coming from.

提交回复
热议问题