0

I am testing an http server, when I send a GET request to the server http://httpserver:10000/test.txt , this server replies with the content of the test.txt file. If I want to add a file to the server, or adjust a file, I assume I should use the method POST, but how to include the content and the name of the file ? Note that the server is java based, and it is acting as a fileserver.

I tried PUT request to the server with url in request= http://httpserver:10000/mytest.txt, but when checking the server, the file is not created. Note that I am using postman to build the requests.

user2340612
  • 10,053
  • 4
  • 41
  • 66
  • My understanding is that you are creating this server, in which case you need to code the logic to read the request body and create/update the file – user2340612 Jul 24 '23 at 11:24
  • @user2340612 No i am not creating this server, but I have access to the server just for testing purposes. – ethicalhacker Jul 24 '23 at 11:27
  • in that case, you need to see what endpoints the server is exposing and, if the endpoints to create/update a file exist, what the request should look like. Whoever created this backend application should also provide the API specification – user2340612 Jul 24 '23 at 11:31
  • https://stackoverflow.com/questions/39037049/how-to-upload-a-file-and-json-data-in-postman – AnotherOne Jul 24 '23 at 11:31
  • @user16320675 I did not force you to read it, but I mentioned that this server is java based and not and httpd server, that's why I tagged java :/ . Sorry for the inconvenience . – ethicalhacker Jul 24 '23 at 12:06
  • @user16320675 noted. Thank you for the constructive feedback. – ethicalhacker Jul 24 '23 at 12:14

0 Answers0