必承其重 | 欲带皇冠 2015-05-23 08:29 采纳率: 0%
浏览 44

Ajax jQuery 401未经授权

I'm working with Wowza streaming platform. I would like to use Wowza API recording API. It works well when I type in web browser. I'm using this link in my Web browser

http://username:password@myurl.com:8086/livestreamrecord?app=live&streamname=myStream&action=startRecording

However, when I used in AJAX called, the prompt pop out which I don't want that to happen.

$.ajax({
    async : false,
    url : "myurl.com:8086/livestreamrecord?app=live&streamname=myStream&action=startRecording",
    type : 'GET',
    dataType: "jsonp",
    beforeSend: function (xhr) {
        xhr.setRequestHeader('Authorization', "Any " + btoa(user+":"+password));
    },
    }).done(function(response){
            alert("RECORDING..");

});

Though username:password@ append in the link in url ajax wouldn't work for me. It produced 401 unauthorised error. I don't want something that prompt out ask for authentication informations but straight direct authorisation without user knowledge.

  • 写回答

0条回答

    报告相同问题?

    悬赏问题

    • ¥15 nginx中的CORS策略应该如何配置
    • ¥30 信号与系统实验:采样定理分析
    • ¥100 我想找人帮我写Python 的股票分析代码,有意请加mathtao
    • ¥20 Vite 打包的 Vue3 组件库,图标无法显示
    • ¥15 php 同步电商平台多个店铺增量订单和订单状态
    • ¥15 关于logstash转发日志时发生的部分内容丢失问题
    • ¥17 pro*C预编译“闪回查询”报错SCN不能识别
    • ¥15 微信会员卡接入微信支付商户号收款
    • ¥15 如何获取烟草零售终端数据
    • ¥15 数学建模招标中位数问题