Skip to content

ERROR: HTTP/2 stream 0 was not closed cleanly: #158

Closed
@magick93

Description

@magick93

Hello

I'm trying to make a POST request, but I'm getting an odd error back. The error is SQL Error [XX000]: ERROR: Error in the HTTP2 framing layer.

The code I'm using is:

post_data := 'from=example.com<' || urlencode (message->>'sender') || '>' ||  
               '&to=' || urlencode (message->>'recipient') || 
--               CASE WHEN message->>'cc' IS NOT NULL THEN '&cc=' || urlencode(message->>'cc') ELSE '' END || 
--               CASE WHEN message->>'bcc' IS NOT NULL THEN '&bcc=' || urlencode(message->>'bcc') ELSE '' END || 
--               CASE WHEN message->>'messageid' IS NOT NULL THEN '&v:messageid=' || urlencode(message->>'messageid') ELSE '' END || 
               '&subject=' || urlencode(message->>'subject') || 
--               '&h:X-Mailgun-Variables=' || urlencode(message->>'payload') ||
               '&template=' || urlencode(message->>'template');

  RAISE NOTICE 'Post Data: %', post_data;
 
 	PERFORM http_set_curlopt('--http1.1', null);
 
-- raise notice 'curl opts: %', http_list_curlopt();

--  SELECT content INTO retval
--    FROM http(('POST', 
--                mailgun_message_url, 
--                ARRAY[
--                	http_header ('Authorization', 'Basic ' || encode(concat('api:', MAILGUN_API_KEY)::bytea, 'base64'::text))
--                	], 
--                'application/json',                 
--                post_data));

   SELECT content INTO retval
    FROM http(('POST', 
                mailgun_message_url, 
                ARRAY[
                	http_header ('Authorization', 'Basic ' || encode(concat('api:', MAILGUN_API_KEY)::bytea, 'base64'::text))
                	], 
                'application/x-www-form-urlencoded',                 
                post_data));
 
 
  RAISE NOTICE 'Mailgun Response: %', retval;

This may be due to the remote server requiring HTTP 1.1. Is it possible to tell curl to use HTTP 1.1 from pgsql-http?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions