Amazon Transcribe Streaming service request in Node.js with Http/2 gives no responseAmazon Transcribe Streaming API without SDKHow is an HTTP POST request made in node.js?Uncompress gzipped http request body to json in Node.jsFailed Amazon SQS requestNode.js quick file server (static files over HTTP)SQS Receive Message RequestAWS Spark Cluster setup errorsGetting “SignatureDoesNotMatch” error with delete Bucket Replication operation in Amazon s3Amazon Transcribe Streaming API without SDKPut Object requests with Object Lock parameters require AWS Signature Version 4How to send gatling request with AWS Signature Version 4?

How can I prevent hyper evolved versions of regular creatures from wiping out their cousins?

Modeling an IP Address

How can I make my BBEG immortal short of making them a Lich or Vampire?

Cross compiling for RPi - error while loading shared libraries

What does the "remote control" for a QF-4 look like?

How is the claim "I am in New York only if I am in America" the same as "If I am in New York, then I am in America?

LWC SFDX source push error TypeError: LWC1009: decl.moveTo is not a function

Replacing matching entries in one column of a file by another column from a different file

Do I have a twin with permutated remainders?

What defenses are there against being summoned by the Gate spell?

How is it possible to have an ability score that is less than 3?

Accidentally leaked the solution to an assignment, what to do now? (I'm the prof)

Why is consensus so controversial in Britain?

What's the point of deactivating Num Lock on login screens?

Theorems that impeded progress

I'm flying to France today and my passport expires in less than 2 months

Can a Cauchy sequence converge for one metric while not converging for another?

Book with a girl whose grandma is a phoenix, cover depicts the emerald/green-eyed blonde girl

Why can't I see bouncing of a switch on an oscilloscope?

NMaximize is not converging to a solution

What's that red-plus icon near a text?

Alternative to sending password over mail?

High voltage LED indicator 40-1000 VDC without additional power supply

Why is Minecraft giving an OpenGL error?



Amazon Transcribe Streaming service request in Node.js with Http/2 gives no response


Amazon Transcribe Streaming API without SDKHow is an HTTP POST request made in node.js?Uncompress gzipped http request body to json in Node.jsFailed Amazon SQS requestNode.js quick file server (static files over HTTP)SQS Receive Message RequestAWS Spark Cluster setup errorsGetting “SignatureDoesNotMatch” error with delete Bucket Replication operation in Amazon s3Amazon Transcribe Streaming API without SDKPut Object requests with Object Lock parameters require AWS Signature Version 4How to send gatling request with AWS Signature Version 4?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















I am trying to use Amazon Transcribe Streaming Service with a http2 request from Node.js, Here is the documentation links that I am following
Streaming request format. According to this document end point is https://transcribe-streaming.<'region'>.amazonaws.com, but making a request to this url gives url not found error.
But in the Java Example found end point as https://transcribestreaming.''.amazonaws.com, so making a request to this url does not give any error or response back. I am trying from us-east-1 region.



Here is the code I am trying with.



const http2 = require('http2');
var aws4 = require('aws4');

var opts =
service: 'transcribe',
region: 'us-east-1',
path: '/stream-transcription',
headers:
'content-type': 'application/json',
'x-amz-target': 'com.amazonaws.transcribe.Transcribe.StartStreamTranscription'



var urlObj = aws4.sign(opts, accessKeyId: '<access key>', secretAccessKey: '<aws secret>');

client.on('error', function(err)
console.error("error in request ",err);
);

const req = client.request(
':method': 'POST',
':path': '/stream-transcription',
'authorization': urlObj.headers.Authorization,
'content-type': 'application/json',
'x-amz-content-sha256': 'STREAMING-AWS4-HMAC-SHA256-EVENTS',
'x-amz-target': 'com.amazonaws.transcribe.Transcribe.StartStreamTranscription',
'x-amz-date': urlObj['headers']['X-Amz-Date'],
'x-amz-transcribe-language-code': 'en-US',
'x-amz-transcribe-media-encoding': 'pcm',
'x-amz-transcribe-sample-rate': 44100
);

req.on('response', (headers, flags) =>
for (const name in headers)
console.log(`$name: $headers[name]`);

);
let data = '';
req.on('data', (chunk) => data += chunk; );
req.on('end', () =>
console.log(`n$data`);
client.close();
);
req.end();


Can anyone point out what I am missing here. I couldn't find any examples implementing this with HTTP/2 either.



Update:
Changing the Content-type to application/json came back with response status 200 but with following exception:



`"Output":"__type":"com.amazon.coral.service#SerializationException","Version":"1.0"`









share|improve this question
























  • Were you ever able to get this to work? I am in a similar situation. Thanks!

    – stephen lizcano
    Mar 11 at 12:59











  • Nope, still stuck on the same issue.

    – Manoj
    Mar 11 at 13:58











  • There is also older documentation for the streaming transcription, which has the correct host but bad content-type :D docs.aws.amazon.com/transcribe/latest/dg/… I am fighting this same API in Go and I was able to get past the initial connection and IAM authentication here stackoverflow.com/questions/53743785/… Not fully working yet though.

    – shelll
    Mar 13 at 14:55











  • Removing/not setting the content-type should help a bit. In my case setting the correct content-type return HTTP 404. I am stuck after that though.

    – shelll
    Mar 13 at 15:40











  • Yup, setting content-type:application/json returned the response with status 200 but with exception "Output":"__type":"com.amazon.coral.service#SerializationException","Version":"1.0"; but if content-type is not provided it gives a 403.

    – Manoj
    Mar 13 at 21:33


















1















I am trying to use Amazon Transcribe Streaming Service with a http2 request from Node.js, Here is the documentation links that I am following
Streaming request format. According to this document end point is https://transcribe-streaming.<'region'>.amazonaws.com, but making a request to this url gives url not found error.
But in the Java Example found end point as https://transcribestreaming.''.amazonaws.com, so making a request to this url does not give any error or response back. I am trying from us-east-1 region.



Here is the code I am trying with.



const http2 = require('http2');
var aws4 = require('aws4');

var opts =
service: 'transcribe',
region: 'us-east-1',
path: '/stream-transcription',
headers:
'content-type': 'application/json',
'x-amz-target': 'com.amazonaws.transcribe.Transcribe.StartStreamTranscription'



var urlObj = aws4.sign(opts, accessKeyId: '<access key>', secretAccessKey: '<aws secret>');

client.on('error', function(err)
console.error("error in request ",err);
);

const req = client.request(
':method': 'POST',
':path': '/stream-transcription',
'authorization': urlObj.headers.Authorization,
'content-type': 'application/json',
'x-amz-content-sha256': 'STREAMING-AWS4-HMAC-SHA256-EVENTS',
'x-amz-target': 'com.amazonaws.transcribe.Transcribe.StartStreamTranscription',
'x-amz-date': urlObj['headers']['X-Amz-Date'],
'x-amz-transcribe-language-code': 'en-US',
'x-amz-transcribe-media-encoding': 'pcm',
'x-amz-transcribe-sample-rate': 44100
);

req.on('response', (headers, flags) =>
for (const name in headers)
console.log(`$name: $headers[name]`);

);
let data = '';
req.on('data', (chunk) => data += chunk; );
req.on('end', () =>
console.log(`n$data`);
client.close();
);
req.end();


Can anyone point out what I am missing here. I couldn't find any examples implementing this with HTTP/2 either.



Update:
Changing the Content-type to application/json came back with response status 200 but with following exception:



`"Output":"__type":"com.amazon.coral.service#SerializationException","Version":"1.0"`









share|improve this question
























  • Were you ever able to get this to work? I am in a similar situation. Thanks!

    – stephen lizcano
    Mar 11 at 12:59











  • Nope, still stuck on the same issue.

    – Manoj
    Mar 11 at 13:58











  • There is also older documentation for the streaming transcription, which has the correct host but bad content-type :D docs.aws.amazon.com/transcribe/latest/dg/… I am fighting this same API in Go and I was able to get past the initial connection and IAM authentication here stackoverflow.com/questions/53743785/… Not fully working yet though.

    – shelll
    Mar 13 at 14:55











  • Removing/not setting the content-type should help a bit. In my case setting the correct content-type return HTTP 404. I am stuck after that though.

    – shelll
    Mar 13 at 15:40











  • Yup, setting content-type:application/json returned the response with status 200 but with exception "Output":"__type":"com.amazon.coral.service#SerializationException","Version":"1.0"; but if content-type is not provided it gives a 403.

    – Manoj
    Mar 13 at 21:33














1












1








1








I am trying to use Amazon Transcribe Streaming Service with a http2 request from Node.js, Here is the documentation links that I am following
Streaming request format. According to this document end point is https://transcribe-streaming.<'region'>.amazonaws.com, but making a request to this url gives url not found error.
But in the Java Example found end point as https://transcribestreaming.''.amazonaws.com, so making a request to this url does not give any error or response back. I am trying from us-east-1 region.



Here is the code I am trying with.



const http2 = require('http2');
var aws4 = require('aws4');

var opts =
service: 'transcribe',
region: 'us-east-1',
path: '/stream-transcription',
headers:
'content-type': 'application/json',
'x-amz-target': 'com.amazonaws.transcribe.Transcribe.StartStreamTranscription'



var urlObj = aws4.sign(opts, accessKeyId: '<access key>', secretAccessKey: '<aws secret>');

client.on('error', function(err)
console.error("error in request ",err);
);

const req = client.request(
':method': 'POST',
':path': '/stream-transcription',
'authorization': urlObj.headers.Authorization,
'content-type': 'application/json',
'x-amz-content-sha256': 'STREAMING-AWS4-HMAC-SHA256-EVENTS',
'x-amz-target': 'com.amazonaws.transcribe.Transcribe.StartStreamTranscription',
'x-amz-date': urlObj['headers']['X-Amz-Date'],
'x-amz-transcribe-language-code': 'en-US',
'x-amz-transcribe-media-encoding': 'pcm',
'x-amz-transcribe-sample-rate': 44100
);

req.on('response', (headers, flags) =>
for (const name in headers)
console.log(`$name: $headers[name]`);

);
let data = '';
req.on('data', (chunk) => data += chunk; );
req.on('end', () =>
console.log(`n$data`);
client.close();
);
req.end();


Can anyone point out what I am missing here. I couldn't find any examples implementing this with HTTP/2 either.



Update:
Changing the Content-type to application/json came back with response status 200 but with following exception:



`"Output":"__type":"com.amazon.coral.service#SerializationException","Version":"1.0"`









share|improve this question
















I am trying to use Amazon Transcribe Streaming Service with a http2 request from Node.js, Here is the documentation links that I am following
Streaming request format. According to this document end point is https://transcribe-streaming.<'region'>.amazonaws.com, but making a request to this url gives url not found error.
But in the Java Example found end point as https://transcribestreaming.''.amazonaws.com, so making a request to this url does not give any error or response back. I am trying from us-east-1 region.



Here is the code I am trying with.



const http2 = require('http2');
var aws4 = require('aws4');

var opts =
service: 'transcribe',
region: 'us-east-1',
path: '/stream-transcription',
headers:
'content-type': 'application/json',
'x-amz-target': 'com.amazonaws.transcribe.Transcribe.StartStreamTranscription'



var urlObj = aws4.sign(opts, accessKeyId: '<access key>', secretAccessKey: '<aws secret>');

client.on('error', function(err)
console.error("error in request ",err);
);

const req = client.request(
':method': 'POST',
':path': '/stream-transcription',
'authorization': urlObj.headers.Authorization,
'content-type': 'application/json',
'x-amz-content-sha256': 'STREAMING-AWS4-HMAC-SHA256-EVENTS',
'x-amz-target': 'com.amazonaws.transcribe.Transcribe.StartStreamTranscription',
'x-amz-date': urlObj['headers']['X-Amz-Date'],
'x-amz-transcribe-language-code': 'en-US',
'x-amz-transcribe-media-encoding': 'pcm',
'x-amz-transcribe-sample-rate': 44100
);

req.on('response', (headers, flags) =>
for (const name in headers)
console.log(`$name: $headers[name]`);

);
let data = '';
req.on('data', (chunk) => data += chunk; );
req.on('end', () =>
console.log(`n$data`);
client.close();
);
req.end();


Can anyone point out what I am missing here. I couldn't find any examples implementing this with HTTP/2 either.



Update:
Changing the Content-type to application/json came back with response status 200 but with following exception:



`"Output":"__type":"com.amazon.coral.service#SerializationException","Version":"1.0"`






node.js amazon-web-services aws-transcribe






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 13 at 21:36







Manoj

















asked Mar 9 at 1:06









ManojManoj

12310




12310












  • Were you ever able to get this to work? I am in a similar situation. Thanks!

    – stephen lizcano
    Mar 11 at 12:59











  • Nope, still stuck on the same issue.

    – Manoj
    Mar 11 at 13:58











  • There is also older documentation for the streaming transcription, which has the correct host but bad content-type :D docs.aws.amazon.com/transcribe/latest/dg/… I am fighting this same API in Go and I was able to get past the initial connection and IAM authentication here stackoverflow.com/questions/53743785/… Not fully working yet though.

    – shelll
    Mar 13 at 14:55











  • Removing/not setting the content-type should help a bit. In my case setting the correct content-type return HTTP 404. I am stuck after that though.

    – shelll
    Mar 13 at 15:40











  • Yup, setting content-type:application/json returned the response with status 200 but with exception "Output":"__type":"com.amazon.coral.service#SerializationException","Version":"1.0"; but if content-type is not provided it gives a 403.

    – Manoj
    Mar 13 at 21:33


















  • Were you ever able to get this to work? I am in a similar situation. Thanks!

    – stephen lizcano
    Mar 11 at 12:59











  • Nope, still stuck on the same issue.

    – Manoj
    Mar 11 at 13:58











  • There is also older documentation for the streaming transcription, which has the correct host but bad content-type :D docs.aws.amazon.com/transcribe/latest/dg/… I am fighting this same API in Go and I was able to get past the initial connection and IAM authentication here stackoverflow.com/questions/53743785/… Not fully working yet though.

    – shelll
    Mar 13 at 14:55











  • Removing/not setting the content-type should help a bit. In my case setting the correct content-type return HTTP 404. I am stuck after that though.

    – shelll
    Mar 13 at 15:40











  • Yup, setting content-type:application/json returned the response with status 200 but with exception "Output":"__type":"com.amazon.coral.service#SerializationException","Version":"1.0"; but if content-type is not provided it gives a 403.

    – Manoj
    Mar 13 at 21:33

















Were you ever able to get this to work? I am in a similar situation. Thanks!

– stephen lizcano
Mar 11 at 12:59





Were you ever able to get this to work? I am in a similar situation. Thanks!

– stephen lizcano
Mar 11 at 12:59













Nope, still stuck on the same issue.

– Manoj
Mar 11 at 13:58





Nope, still stuck on the same issue.

– Manoj
Mar 11 at 13:58













There is also older documentation for the streaming transcription, which has the correct host but bad content-type :D docs.aws.amazon.com/transcribe/latest/dg/… I am fighting this same API in Go and I was able to get past the initial connection and IAM authentication here stackoverflow.com/questions/53743785/… Not fully working yet though.

– shelll
Mar 13 at 14:55





There is also older documentation for the streaming transcription, which has the correct host but bad content-type :D docs.aws.amazon.com/transcribe/latest/dg/… I am fighting this same API in Go and I was able to get past the initial connection and IAM authentication here stackoverflow.com/questions/53743785/… Not fully working yet though.

– shelll
Mar 13 at 14:55













Removing/not setting the content-type should help a bit. In my case setting the correct content-type return HTTP 404. I am stuck after that though.

– shelll
Mar 13 at 15:40





Removing/not setting the content-type should help a bit. In my case setting the correct content-type return HTTP 404. I am stuck after that though.

– shelll
Mar 13 at 15:40













Yup, setting content-type:application/json returned the response with status 200 but with exception "Output":"__type":"com.amazon.coral.service#SerializationException","Version":"1.0"; but if content-type is not provided it gives a 403.

– Manoj
Mar 13 at 21:33






Yup, setting content-type:application/json returned the response with status 200 but with exception "Output":"__type":"com.amazon.coral.service#SerializationException","Version":"1.0"; but if content-type is not provided it gives a 403.

– Manoj
Mar 13 at 21:33













0






active

oldest

votes












Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55073003%2famazon-transcribe-streaming-service-request-in-node-js-with-http-2-gives-no-resp%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55073003%2famazon-transcribe-streaming-service-request-in-node-js-with-http-2-gives-no-resp%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme

Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived