# How to test a write without a pass

Send a write with no pass and confirm that it is refused. Nothing should be stored. This is the check you want after you mark a route.

On the hosted [demo](/demo), the contact form posts to `/demo/contact`. Send that route without a cookie, hidden field, or `Authorization` header:

```sh
curl -sS -D - -o /dev/null -X POST https://attackfee.dev/demo/contact -d "message=hi"
```

Expect HTTP 403. Then send the same post as an agent:

```sh
curl -sS -D - -o /dev/null -X POST https://attackfee.dev/demo/contact -d "message=hi" \
  -H "Attackfee-Client: agent"
```

Expect HTTP 402. You can inspect the body for a `challenge_url` and, when payments are on, a price. Do not hardcode the dollar figure.

On your own site, post to the route you marked, the same way. If you get 200 and the write is stored, the server check is missing. If you get 503, the store is down and the issuer is failing closed, which is a different case.

The exact contact path on a local demo is the form you start with `npm run demo`. Use that origin instead of the hosted one when you are testing a clone.

## Where Attackfee fits

See [What happens if a write has no pass?](/learn/concepts/what-happens-without-a-pass) and [Walk through the hosted demo](/learn/concepts/try-the-demo).

- [Attackfee](/)
- [Learn](/learn)
- [Concepts](/learn/concepts)
- [How to test a write without a pass](/learn/concepts/how-to-test-a-write-without-a-pass)

## Related

- [Attackfee Learning Center](/learn)
- [Walk through the hosted demo](/learn/concepts/try-the-demo)
- [What happens if a write has no pass?](/learn/concepts/what-happens-without-a-pass)
- [Demo](/demo)
- [Agent](/docs/agent)

## Questions



### "Which URL should I post to?"

"On the hosted demo, POST /demo/contact. On the local demo, POST /contact. On your own site, the route you marked as a write."

### "What should a missing pass return?"

"403 and attackfee_required for a browser-style request. 402 for a request that sends Attackfee-Client: agent."

### "What if I get 503?"

"That means the pass store is down, not that the pass was merely missing. Protected writes fail closed."

### "Does this test payments?"

"No. It tests the refusal when no pass is present. A valid payment path, when it is on, is a separate step after the 402."
