occ-ai / obs-urlsource

OBS plugin to fetch data from a URL or file, connect to an API or AI service, parse responses and display text, image or audio on scene
https://obsproject.com/forum/resources/url-api-source-fetch-live-data-and-display-it-on-screen.1756/
GNU General Public License v2.0
130 stars 18 forks source link

Post body format for Laravel API #99

Closed lelu0 closed 2 weeks ago

lelu0 commented 3 weeks ago

Hi, I have a Laravel API which is working fine in postman while is setup like this: image

When I use same setup in the plugin, input isn't correct as you can see on the screen when I dumped response: image image

Could you assist me with this? What body format should be used to API parse input correctly? I'm using Laravel native Request class so I'm sure that API is working correctly.

royshil commented 3 weeks ago

This output you're getting is not valid JSON for some reason But you can try parsing it anyway (probably would fail) You most likely need headers on your request to ask for a JSON output Like Content-Type: application/json (this is more for your provided body, not for the output) Or better Accept: application/json

lelu0 commented 3 weeks ago

Yes, you are right. If someone ends up looking for the answer here are the correct settings: image

royshil commented 2 weeks ago

done here