post-bogus-ap-note 1.6 KB

1234567891011121314151617181920212223242526272829
  1. #!/bin/sh
  2. readonly TARGET_INBOX_URL=localhost:8000/forge-fed/alice@example.net/inbox/
  3. # readonly TARGET_INBOX_URL=https://forge.angeley.es/inbox
  4. read -r -d '' BOGUS_AP_NOTE <<-'BOGUSAPNOTE'
  5. {
  6. "@context" : "https://www.w3.org/ns/activitystreams" ,
  7. "attributedTo" : "charlie@example.net" ,
  8. "cc" : [ "alice@example.net/followers" ] ,
  9. "content" : "<p>Hello Note</p>" ,
  10. "id" : "0123456789ABCDEF" ,
  11. "published" : "2019-03-08T21:09:14Z" ,
  12. "sensitive" : "False" ,
  13. "source" : { "mediaType" : "text/plain", "content": "Hello Note" } ,
  14. "tag" : [] ,
  15. "to" : [ "alice@example.net" ] ,
  16. "type" : "Note" ,
  17. "url" : "https://example.net:5000/charlie@example.net/note/0123456789ABCDEF"
  18. }
  19. BOGUSAPNOTE
  20. # curl -X POST --data '{"k1":"v1","k2":"v2"}' $TARGET_INBOX_URL
  21. # curl -X POST --data @NOSUCHFILE $TARGET_INBOX_URL
  22. curl -w "%{http_code}\\n" \
  23. -H "Content-Type: application/activity+json" \
  24. -H "Accept: application/json" \
  25. -X POST --data "$BOGUS_AP_NOTE" $TARGET_INBOX_URL