Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Is it possible to call POST method of a servlet directly using URL?  RSS feed

 
Kishor Joshi
Ranch Hand
Posts: 674
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there

I am working on a web application

suppose I have a servlet configured as

"http://myWebApp/someURL"

and I am calling /someURL post method Internally from my code

myQuestion is I can call get method of "/someURL" something like

"http://myWebApp/someURL?someParameter=someValue.."

My Question is from any aspect is it possible to call post Method directly from the URL?

(I am analysing this point from security aspect of web application)

Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course. How else would it be "called" if not by URL?

P.S. Though it's bad form to place request params on the URL when POSTing. Params should go in the request body.
 
Kishor Joshi
Ranch Hand
Posts: 674
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How?

can you clarfy it by giving some example

I am not calling post from HTML

I only want to call POST method using URL only
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have no idea what you are asking.

Any time you submit a request from a form using the POST method, you are making a post by URL. Or it can be done using Ajax. Or from Java code using the appropriate methods. Or from PHP code. Or from the command line with curl. Or from a tool like POSTMAN. Or from.... you get the idea.

But no matter how you create the request, it's being made via URL.

So, I ask again, what do you mean by "by URL"? What other way is there?

Or -- taking a wild stab -- do you mean by typing a URL into the address bar of a browser? If so, then no. But if that's what you meant to ask, please be more explicit in the future.
 
Kishor Joshi
Ranch Hand
Posts: 674
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Or -- taking a wild stab -- do you mean by typing a URL into the address bar of a browser? If so, then no.



I am asking this one,this is my answar

Any time you submit a request from a form using the POST method, you are making a post by URL. Or it can be done using Ajax. Or from Java code using the appropriate methods. Or from PHP code. Or from the command line with curl. Or from a tool like POSTMAN. Or from.... you get the idea.


I Know it very well


But if that's what you meant to ask, please be more explicit in the future.


sure thanks for clearfication
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want a means to easily make POST requests without needing to write code, check out the POSTMAN plugin for Chrome.
 
Abhay Agarwal
Ranch Hand
Posts: 1376
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if we talk of plugins, you can try HTTPRequester plugin of Mozilla
https://addons.mozilla.org/En-us/firefox/addon/httprequester/
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!