mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
16 lines
672 B
TypeScript
16 lines
672 B
TypeScript
import { DataFactory } from 'n3';
|
|
import { SOLID_HTTP } from '../../../util/Vocabularies';
|
|
import { RepresentationMetadata } from '../../representation/RepresentationMetadata';
|
|
import type { ResourceIdentifier } from '../../representation/ResourceIdentifier';
|
|
import { ResponseDescription } from './ResponseDescription';
|
|
|
|
/**
|
|
* Corresponds to a 201 response, containing the relevant link metadata.
|
|
*/
|
|
export class CreatedResponseDescription extends ResponseDescription {
|
|
public constructor(location: ResourceIdentifier) {
|
|
const metadata = new RepresentationMetadata({ [SOLID_HTTP.location]: DataFactory.namedNode(location.path) });
|
|
super(201, metadata);
|
|
}
|
|
}
|