Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
jira rest api generates 426 error
#3
(06-07-2022, 12:16 AM)rlebeau Wrote:
(06-06-2022, 08:11 PM)pohukai Wrote: I'm at a loss as to what isn't set correctly and needs to be 'upgraded'.

What does your code look like?  What does the actual HTTP request look like?  Does Jira's HTTP response include an "Upgrade" header? It should be telling you what the server wants you to upgrade to.

Here is the method call, where I pass the URL and a filename, including the path.

function TfrmJiraAttachment.upload(aUrl: string; aFileName : string) : boolean;
var
  mpStream : TIdMultiPartFormDataStream;
  RespStr  : String;
begin

  (*
  According to atlassian's documentations:

  TLS version 1.2 (or higher) is required for all
  Atlassian products and services.

  TLS version 1.1 and lower is unsupported.

  Any version of SSL is unsupported.

  https://support.atlassian.com/security-a...-products/
  *)

  mpStream := TIdMultipartFormDataStream.Create;
  HTTP.Request.CustomHeaders.AddValue('X-Atlassian-Token', 'nocheck');
  mpStream.AddFile('file', aFileName);
  Http.ProtocolVersion := pv1_1;

  ssl.SSLOptions.Method      := sslvTLSv1_2;
  ssl.SSLOptions.SSLVersions := [sslvTLSv1_2];
  HTTP.Request.ContentType  := 'multipart/form-data';
  try
  RespStr := HTTP.Post( aUrl, mpStream);

  Result := true;
  log.Lines.Add ('success!' );
  except

  on e: exception do
    begin
      log.Lines.Add ('exception:' + e.Message);
    
    end;

  end;
  mpStream.Free;
end;


This is what is in the raw response header:
Access-Control-Allowed-Origin: *
Vary: Accept-Encoding
Date: Tue, 07 Jun 2022 18:31:30 GMT
Server: globaledge-envoy
Connection: close
Content-Length: 0
Reply


Messages In This Thread
jira rest api generates 426 error - by pohukai - 06-06-2022, 08:11 PM
RE: jira rest api generates 426 error - by pohukai - 06-07-2022, 06:29 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)