|
|
|
@ -7,6 +7,7 @@ import * as url from 'url'
|
|
|
|
|
import {Response} from './Response'
|
|
|
|
|
import * as Negotiator from 'negotiator'
|
|
|
|
|
import {HTTPError} from '../HTTPError'
|
|
|
|
|
import {ActivatedRoute} from '../routing/ActivatedRoute'
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Enumeration of different HTTP verbs.
|
|
|
|
@ -177,20 +178,25 @@ export class Request extends ScopedContainer implements DataContainer {
|
|
|
|
|
* @param key
|
|
|
|
|
*/
|
|
|
|
|
public input(key?: string): unknown {
|
|
|
|
|
if ( !key ) {
|
|
|
|
|
return {
|
|
|
|
|
...this.parsedInput,
|
|
|
|
|
...this.query,
|
|
|
|
|
...this.uploadedFiles,
|
|
|
|
|
let sources = {
|
|
|
|
|
...this.parsedInput,
|
|
|
|
|
...this.query,
|
|
|
|
|
...this.uploadedFiles,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( this.hasKey(ActivatedRoute) ) {
|
|
|
|
|
sources = {
|
|
|
|
|
...sources,
|
|
|
|
|
...this.make<ActivatedRoute<unknown, unknown[]>>(ActivatedRoute).params,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( key in this.parsedInput ) {
|
|
|
|
|
return this.parsedInput[key]
|
|
|
|
|
if ( !key ) {
|
|
|
|
|
return sources
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( key in this.query ) {
|
|
|
|
|
return this.query[key]
|
|
|
|
|
if ( key in sources ) {
|
|
|
|
|
return sources[key]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|