UNPKG

graphql-yoga

Version:

<div align="center"><img src="./website/public/cover.png" width="720" /></div>

10 lines (9 loc) 402 B
import { isContentTypeMatch, parseURLSearchParams } from './utils.js'; export function isPOSTFormUrlEncodedRequest(request) { return (request.method === 'POST' && isContentTypeMatch(request, 'application/x-www-form-urlencoded')); } export async function parsePOSTFormUrlEncodedRequest(request) { const requestBody = await request.text(); return parseURLSearchParams(requestBody); }