if (method != QLatin1String("GET") &&
method != QLatin1String("PUT") &&
method != QLatin1String("HEAD") &&
- method != QLatin1String("POST"))
+ method != QLatin1String("POST") &&
+ method != QLatin1String("DELETE"))
- THROW_DOM(SYNTAX_ERR, "Unsupported HTTP method type");
-
+ V8THROW_DOM(SYNTAX_ERR, "Unsupported HTTP method type");
// Argument 1 - URL
- QUrl url = QUrl::fromEncoded(context->argument(1).toString().toUtf8());
+ QUrl url = QUrl::fromEncoded(engine->toString(args[1]).toUtf8());
- if (url.isRelative()) {
- url = QDeclarativeScriptEngine::get(engine)->resolvedUrl(context,url);
- }
+ if (url.isRelative())
+ url = engine->callingContext()->resolvedUrl(url);
// Argument 2 - async (optional)
- if (context->argumentCount() > 2 && !context->argument(2).toBoolean())
- THROW_DOM(NOT_SUPPORTED_ERR, "Synchronous XMLHttpRequest calls are not supported");
-
+ if (args.Length() > 2 && !args[2]->BooleanValue())
+ V8THROW_DOM(NOT_SUPPORTED_ERR, "Synchronous XMLHttpRequest calls are not supported");
// Argument 3/4 - user/pass (optional)
QString username, password;