Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jmeter_ Response Error Like :http response code: 405 Method not allowed

Tags:

jmeter

when i am trying to upload the image in the web application using POST method of HTTP using Jmeter ,Its throwing error as below

Sampler Request:

Size in bytes: 436
Headers size in bytes: 335
Body size in bytes: 101
Sample Count: 1
Error Count: 1
Data type ("text"|"bin"|""): text
Response code: 405
Response message: Method Not Allowed

Response headers:
HTTP/1.1 405 Method Not Allowed
Allow: GET, HEAD, OPTIONS, TRACE
Content-Length: 101
Content-Type: text/html
Server: Microsoft-IIS/8.0
X-Powered-By: ASP.NET
Set-Cookie: ARRAffinity=a1634f39ccba9517317254d32be7078bb62c2877a947d85cab990f2708382045;Path=/;Domain=revflexsit.azurewebsites.net
Date: Tue, 28 Jun 2016 10:04:41 GMT


HTTPSampleResult fields:
ContentType: text/html
DataEncoding: null

Request:

POST http://revflexsit.azurewebsites.net/#//testerprofile

POST data:
--8WPDqrXY5glD81_9CcLHn-xfOTrWvH4Dh4srjx
Content-Disposition: form-data; name="profileUploadPhoto"; filename="Tulips.jpg"
Content-Type: image/jpeg
Content-Transfer-Encoding: binary

<actual file content, not shown here>
--8WPDqrXY5glD81_9CcLHn-xfOTrWvH4Dh4srjx--


[no cookies]

Request Headers:
Connection: keep-alive
Content-Length: 621121
Content-Type: multipart/form-data; boundary=8WPDqrXY5glD81_9CcLHn-xfOTrWvH4Dh4srjx; charset=US-ASCII
Host: revflexsit.azurewebsites.net
User-Agent: Apache-HttpClient/4.5.2 (Java/1.8.0_40)

Response Data:

The page you are looking for cannot be displayed because an invalid method (HTTP verb) is being used.
like image 733
Mohamed Noushad Avatar asked Nov 28 '25 08:11

Mohamed Noushad


1 Answers

The server response is pretty much self-explanatory, you're not allowed to make POST requests to that URL, only GET, HEAD, OPTION and TRACE ones.

Why just not to record your test scenario using HTTP(S) Test Script Recorder and modify the resulting test "skeleton" as required?

If you are still eager to build your scenario manually,looking into the http://revflexsit.azurewebsites.net/ site, it seems correct request will look something like:

  • Path: /api/TesterProfile/UploadTesterProfile?Id=${YOUR_ID_HERE}&UpdateAdminId=0&dimensions=x,y,x,y
  • Files Upload:

    • File Path: full path to image, you're trying to upload
    • Parameter Name: profileUploadPhoto
    • MIME Type: relevant photo MIME Type

Don't forget to tick "Use multipart/form-data for POST" box.

See How to Test Image Upload Functionality With JMeter for more detailed explanation.

like image 86
Dmitri T Avatar answered Nov 29 '25 22:11

Dmitri T