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

Thal And Out Agency railway station See also References External links Navigation menuOfficial Web Site of Pakistan RailwaysArchivedOfficial Web Site of Pakistan Railwayseeexpanding ite

Posting a File and Associated Data to a RESTful WebService preferably as JSON2019 Community Moderator ElectionREST URI convention - Singular or plural name of resource while creating itUploading both data and files in one form using Ajax?How do I upload a file with metadata using a REST web service?REST API - file (ie images) processing - best practicesSpring: JSON data and file in the same requestREST API Put large dataPosting a file and JSON data to Spring rest serviceRESTful Web Service Upload/Download Large Data With JSONREST API Design sending JSON data and a file to the api in same requestPost JSONArray to REST servicePUT vs. POST in RESTParsing values from a JSON file?JavaScript/jQuery to download file via POST with JSON dataHow do I upload a file with metadata using a REST web service?How to POST JSON data with Curl from Terminal/Commandline to Test Spring REST?Separate REST JSON API server and client?what's the correct way to send a file from REST web service to client?How do I write JSON data to a file?What is “406-Not Acceptable Response” in HTTP?REST API - file (ie images) processing - best practices

How can I change the color of pagination dots of UIPageControl?How to change UIPageControl dotsIs there a way to change page indicator dots colorCustomize dot with image of UIPageControl at index 0 of UIPageControlNo visible @interface for 'NSObject<PageControlDelegate>' declares the selector 'pageControlPageDidChange:'How to change the color of pagination dots in UIPageControl with a different color per pagepagecontrol indicator custom image instead of DefaultChanging the colour of UIPageControl dots in MonoTouchpagecontrol selectable page visibility color?Alternative way to load ViewControllers on a UIPageControlHow to set only layer.border-color for UIpage control dots in swiftHow can I develop for iPhone using a Windows development machine?How to change the name of an iOS app?UITableView - change section header coloruipagecontrol indicator(dot)issueCustom UIPageControl dots color not changingchange the interspace between UIPageControl dotsHow to change Status Bar text color in iOSHow can I change image tintColor in iOS and WatchKitUIPageControl dots with larger space in between each dotsHow to change the color of pagination dots in UIPageControl with a different color per page