skip to Main Content

How to get JSON output from gemini-1.5-pro-001 using curl

How can I retrieve data in JSON format from the Gemini 1.5 API using curl? The code below works correctly: curl -H 'Content-Type: application/json' -H "x-goog-api-key: ${API_KEY}" -d '{"contents":[ {"role": "user", "parts":[{"text": "Give me five subcategories of jazz?"}]}]}' "https://generativelanguage.googleapis.com/v1/models/gemini-pro:generateContent" But…

VIEW QUESTION

How to use Curl with credentials in PHP

Trying to use curl to call api response. The only documentation is this: https://stage-sgf-partner-api.azurewebsites.net/api/swagger/ui#/Person/PartnerApi_Person_GetGolferInfoByGolfId I have ClientId and Password to use for the server. This is the error message from server. "Failed to load API definition. Errors Fetch error NetworkError…

VIEW QUESTION

Apache – nghttp2_option_set_no_rfc9113_leading_and_trailing_ws_validation could not be located in the dynamic link library php-8.3.4extphp_curl.dll

While I am starting apache server from laragon on windows I am getting this error: The procedure entry point nghttp2_option_set_no_rfc9113_leading_and_trailing_ws_validation could not be located in the dynamic link library F:laragonbinphpphp-8.3.4-Win32-vs16-x64extphp_curl.dll As it is saying it can't locate the the dynamic…

VIEW QUESTION

PHP curl authorization and parse product table from another link (i get login page again)

$ch = curl_init(); $post_field = 'ajax=SearchArticulo&cntrSgn=DeExMEkRabGEO396gOLDMqUZiXe2BibRjqgUXwZlQmMgrw4jJmdAwbUD11%2BddBhn&srcInicio=false&isSimple=false&codMarca=0&field=nombre&value=&oferta=false&pvpSubido=False&detallada=false&codPedido='; $post_field .= '&cat1=5&cat2=95&cat3=0&token=&User=user&Pwd=password'; curl_setopt($ch, CURLOPT_URL, 'https://actibios.com/WebForms/Clientes/GenerarPedidosVentas_new.aspx'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_field); curl_setopt($ch, CURLOPT_USERAGENT, 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36'); curl_setopt ($ch, CURLOPT_REFERER, 'https://actibios.com/WebForms/Clientes/GenerarPedidosVentas_new.aspx');…

VIEW QUESTION
Back To Top
Search