MCPcopy
hub / github.com/payloadcms/payload / POST

Method POST

test/__helpers/shared/NextRESTClient.ts:241–253  ·  view source on GitHub ↗
(
    path: ValidPath,
    options: FileArg & RequestInit & RequestOptions = {},
  )

Source from the content-addressed store, hash-verified

239 }
240
241 async POST(
242 path: ValidPath,
243 options: FileArg & RequestInit & RequestOptions = {},
244 ): Promise<Response> {
245 const { slug, params, url } = this.generateRequestParts(path)
246 const queryParams = generateQueryString({}, params)
247 const request = new Request(`${url}${queryParams}`, {
248 ...options,
249 headers: this.buildHeaders(options),
250 method: 'POST',
251 })
252 return this._POST(request, { params: Promise.resolve({ slug }) })
253 }
254
255 async PUT(path: ValidPath, options: FileArg & RequestInit & RequestOptions): Promise<Response> {
256 const { slug, params, url } = this.generateRequestParts(path)

Callers 15

loginMethod · 0.95
int.spec.tsFile · 0.80
int.spec.tsFile · 0.80
int.spec.tsFile · 0.80
tryLoginFunction · 0.80
int.spec.tsFile · 0.80
int.spec.tsFile · 0.80
int.spec.tsFile · 0.80
int.spec.tsFile · 0.80
hooks.int.spec.tsFile · 0.80

Calls 3

generateRequestPartsMethod · 0.95
buildHeadersMethod · 0.95
generateQueryStringFunction · 0.85

Tested by 4

tryLoginFunction · 0.64
createGuestCartWithItemsFunction · 0.64
requestHandlerFunction · 0.64
createPostFunction · 0.64