mozilla

Compare Revisions

Web Console remoting

Change Revisions

Revision 458851:

Revision 458851 by mihaisucan on

Revision 458875:

Revision 458875 by mihaisucan on

Title:
Web Console remoting
Web Console remoting
Slug:
Tools/Web_Console/remoting
Tools/Web_Console/remoting
Tags:
"Référence", "Reference", "web console", "Debugging"
"Référence", "Reference", "web console", "Debugging"
Content:

Revision 458851
Revision 458875
nn266    <h3 id="Send_HTTP_requests">
267      Send HTTP requests
268    </h3>
269    <p>
270      Starting with Firefox 25 you can send an HTTP request using
 > the console actor:
271    </p>
272    <pre class="brush:json;">
273{
274  "to": "conn0.console9",
275  "type": "sendHTTPRequest",
276  "request": {
277    "url": "http://localhost",
278    "method": "GET",
279    "headers": [
280      {
281        name: "Header-name",
282        value: "header value",
283      },
284      // ...
285    ],
286  },
287}
288</pre>
289    <p>
290      The response packet is a network event actor grip:
291    </p>
292    <pre class="brush:json;">
293{
294  "to": "conn0.console9",
295  "eventActor": {
296    "actor": "conn0.netEvent14",
297    "startedDateTime": "2013-08-26T19:50:03.699Z",
298    "url": "http://localhost",
299    "method": "GET"
300    "isXHR": true,
301    "private": false
302  }
303}
304</pre>
305    <p>
306      You can also use the <code>webConsoleClient.sendHTTPRequest
 >(request, onResponse)</code> method. The <code>request</code> arg
 >ument is the same as the <code>request</code> object in the above
 > example request packet.
307    </p>
t750      <li>Firefox 25: added the <code>getPreferences</code> requet792      <li>Firefox 25: added the <code>getPreferences</code> and <
>st packet to the console actor, <a href="https://bugzilla.mozilla>code>sendHTTPRequest</code> request packets to the console actor,
>.org/show_bug.cgi?id=886067">bug 886067</a>.> <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=886067" ti
 >tle="Bug 886067 - Netmonitor displays request sizes as '0 KB' aft
 >er opening Console">bug 886067</a> and <a href="https://bugzilla.
 >mozilla.org/show_bug.cgi?id=731311" title="Bug 731311 - Network m
 >onitor should allow to replay and edit requests">bug 731311</a>.

Back to History