Make a post from Chrome Dev tool?

24,124 views
Skip to first unread message

ChrisDane

unread,
May 18, 2011, 5:17:00 PM5/18/11
to Google Chrome Developer Tools
Hi there,

Is it possible to create a "Post" and fire it off in Chrome Dev Tools?

I am trying to easily test a doPost method in a HttpServlet - or do I
have to create a Form or a client to do that?

Thanks
Regards
/Chris

PhistucK

unread,
May 19, 2011, 1:52:46 AM5/19/11
to google-chrome-...@googlegroups.com
XMLHttpRequest can fire POST requests.

PhistucK

ChrisDane

unread,
May 19, 2011, 5:28:47 AM5/19/11
to Google Chrome Developer Tools
Thanks, you are right. Though, how would you go about doing it,
writing the script and run it from the dev tool.

Like:
1) Open the developer tool
2) Go to the Scripting tab
3) And than what :-)

Thanks again
Regards
Chris

On May 19, 7:52 am, PhistucK <phist...@gmail.com> wrote:
> XMLHttpRequest can fire POST requests.
>
> ☆*PhistucK*

PhistucK

unread,
May 19, 2011, 5:54:12 AM5/19/11
to google-chrome-...@googlegroups.com
In what context are you asking this?
What are you trying to do?
How are the Developer Tools related here?

You can only execute JavaScript within the context of the page you are inspecting with the Developer Tools. You can do that through the Console panel. You cannot make unauthorized cross origin requests, though.

PhistucK

ChrisDane

unread,
May 19, 2011, 6:32:09 AM5/19/11
to Google Chrome Developer Tools
I am trying to test an Google App Engine HttpServlet method "doPost".
And in order to hit this method with a POST, I just thought that it
might be possible and easier to test this from a browser - that is not
creating a Form on the Server, but just firing off different http
requests to the server. Hope it makes sense.

Thanks again

On May 19, 11:54 am, PhistucK <phist...@gmail.com> wrote:
> In what context are you asking this?
> What are you trying to do?
> How are the Developer Tools related here?
>
> You can only execute JavaScript within the context of the page you are
> inspecting with the Developer Tools. You can do that through the Console
> panel. You cannot make unauthorized cross origin requests, though.
>

PhistucK

unread,
May 19, 2011, 6:43:42 AM5/19/11
to google-chrome-...@googlegroups.com
So go to a page on the same App Engine (sub) domain, open the Developer Tools, go to the Console panel, type the usual XMLHttpRequest code in it and press Enter.
The Network panel will show you the request/response information after you do that.
PhistucK

ChrisDane

unread,
May 24, 2011, 6:50:25 AM5/24/11
to Google Chrome Developer Tools
Thanks mate, it works nicely.



On May 19, 12:43 pm, PhistucK <phist...@gmail.com> wrote:
> So go to a page on the same App Engine (sub) domain, open the Developer
> Tools, go to the Console panel, type the usual XMLHttpRequest code in it and
> press Enter.
> The Network panel will show you the request/response information after you
> do that.
Reply all
Reply to author
Forward
0 new messages