88
edits
| Line 25: | Line 25: | ||
= Current Proposal = | = Current Proposal = | ||
* Last modified: August | * Last modified: August 25, 2009 | ||
* Author: Darin Fisher (Google) and Julian Reschke (greenbytes) | * Author: Darin Fisher (Google) and Julian Reschke (greenbytes) | ||
* Contributors: Ian Melven (Adobe) | * Contributors: Ian Melven (Adobe) | ||
| Line 34: | Line 34: | ||
NPError NPN_HttpRequest( | NPError NPN_HttpRequest( | ||
NPP instance, | NPP instance, | ||
PRUInt64 flags, // control redirects etc | |||
const char* method, | const char* method, | ||
const char* url, | const char* url, | ||
| Line 44: | Line 45: | ||
</pre> | </pre> | ||
and have a matching plugin method that would be called | and have a matching plugin method that would be called everytime the state of the request state changes (see [http://www.w3.org/TR/XMLHttpRequest/#states XHR states]). | ||
<pre> | <pre> | ||
void NPP_HttpResponseNotify( | void NPP_HttpResponseNotify( | ||
int requestState, | |||
NPP instance, | NPP instance, | ||
const char* url, | const char* url, | ||
int | int httpResponseStatus, | ||
const char* headers, // potentially including the status line | const char* headers, // potentially including the status line | ||
void* notifyData); | void* notifyData); | ||
</pre> | </pre> | ||
A callback with requestState == [http://www.w3.org/TR/XMLHttpRequest/#done-state DONE] would then signal the completion of the request. | |||
To address potential security issues with certain HTTP methods (for instance, TRACE), and to allow easier deployment, support for methods other than GET and POST would only be RECOMMENDED, and a new status code (see below) allows the caller to detect this condition. | To address potential security issues with certain HTTP methods (for instance, TRACE), and to allow easier deployment, support for methods other than GET and POST would only be RECOMMENDED, and a new status code (see below) allows the caller to detect this condition. | ||
| Line 67: | Line 69: | ||
=== Open Issues === | === Open Issues === | ||
* Do we need a separate callback for the final state (as in NPN_PostURLNotify, or should we just keep calling NPP_HttpResponseNotify and add a status field as in XmlHttpRequest?) | * Do we need a separate callback for the final state (as in NPN_PostURLNotify, or should we just keep calling NPP_HttpResponseNotify and add a status field as in XmlHttpRequest?) | ||
edits