await fetch("https://bsky.social/xrpc/com.atproto.server.createSession", { method: "POST", headers: { "Content-Type": "application/json" }, body: "{\"identifier\":\"handle.bsky.social\",\"password\":\"...\"}", });
curl → fetch.
paste a curl command — get a fetch() call (and axios) ready to drop into your js. handles flags: -X, -H, -d, -u, -L, --json, and more.
── parsed
methodPOST
urlhttps://bsky.social/xrpc/com.atproto.server.createSession
headers1
body52 bytes
await axios({ url: "https://bsky.social/xrpc/com.atproto.server.createSession", method: "post", headers: { "Content-Type": "application/json" }, data: "{\"identifier\":\"handle.bsky.social\",\"password\":\"...\"}", });
const res = await fetch("https://bsky.social/xrpc/com.atproto.server.createSession", { method: "POST", headers: { "Content-Type": "application/json" }, body: "{\"identifier\":\"handle.bsky.social\",\"password\":\"...\"}", }); const text = await res.text(); console.log(res.status, text);