pramsey/pgsql-http

File upload

mtvan opened this issue · 1 comments

mtvan commented

I'm trying to emulate a file upload without actually selecting a file since I know the contents of what the file would be from a query. I can't seem to get it to work tho.

Here's what I tried

select * from http((
'POST',
'https://api.openai.com/v1/files',
ARRAY[http_header('Authorization','...')],
'multipart/form-data',
'purpose=search&file='||url_encode(b.lines)
)::http_request)

Sorry, can't help.