# content-type v3 end-to-end receipts (netlify dev --offline, built CLI from branch netliloop/392/content-type-esm) ## 1. urlencoded POST $ curl -s -o - -w "\nHTTP %{http_code}\n" -X POST -H "Content-Type: application/x-www-form-urlencoded" --data "form-name=contact&name=Ada&email=ada%40example.com" http://localhost:47611/ {"ok":true,"data":{"form-name":"contact","name":"Ada","email":"ada@example.com","ip":"::ffff:127.0.0.1","user_agent":"curl/8.5.0"}} HTTP 200 ## 2. multipart POST with attachment $ curl -s -w "\nHTTP %{http_code}\n" -F form-name=contact -F name=Grace -F attachment=@att.txt http://localhost:47611/ {"ok":true,"data":{"form-name":"contact","name":"Grace","attachment":{"filename":"att.txt","size":12,"type":"text/plain","url":"/tmp/TjK92cIxQX-PbB_Zly1gJ2RA.txt"},"ip":"::ffff:127.0.0.1","user_agent":"curl/8.5.0"}} HTTP 200 ## 3. POST with no Content-Type HTTP 405 ## 4. POST with malformed Content-Type 'not/a valid; ;;' HTTP 405 ## 5. JSON POST (must not be treated as a form) HTTP 405 ## 6. urlencoded with charset parameter {"ok":true,"data":{"form-name":"contact","name":"Charset","ip":"::ffff:127.0.0.1","user_agent":"curl/8.5.0"}} HTTP 200 ## 7. server still up: GET / HTTP 200 ## dev server log (function output) │ Local dev server ready: http://localhost:47611 │ ⬥ Loaded function submission-created with warnings: - The function is using the legacy CommonJS format. To start using ES modules, rename the function file to submission-created.mjs. Refer to https://ntl.fyi/functions-runtime for more information. [submission-created] fields: {"form-name":"contact","name":"Ada","email":"ada@example.com","ip":"::ffff:127.0.0.1","user_agent":"curl/8.5.0"} [submission-created] fields: {"form-name":"contact","name":"Grace","attachment":{"filename":"att.txt","size":12,"type":"text/plain","url":"/tmp/TjK92cIxQX-PbB_Zly1gJ2RA.txt"},"ip":"::ffff:127.0.0.1","user_agent":"curl/8.5.0"} [submission-created] fields: {"form-name":"contact","name":"Charset","ip":"::ffff:127.0.0.1","user_agent":"curl/8.5.0"}