smx-smx / ezinject-webapi

2 stars 0 forks source link

API Design #1

Open tuxuser opened 3 years ago

tuxuser commented 3 years ago

Proposal for basic API

Types

u8, i8, u16, i16, u32, i32, u64, i64 bytes

Read

GET /api/peek/{type}/{0xaddress}

Response body

Primitive types: 0x42.. Bytes: base64?

Write - Poke

PUT /api/poke/{type}/{0xaddress}

Request body

Primitive types: 0x42.. Bytes: base64?

Response body

Bytes written

smx-smx commented 3 years ago

Maybe it's easier to just have a single one for read, with a size parameter and an encoding parameter. The encoding determines if the output will be:

For write, the encoding field applies to the data supplied. It might make sense to have the parameters inside the querystring and the payload raw (not as a url-encoded form) so it's easier to pass from say curl

tuxuser commented 3 years ago

Okay, sounds good