English 中文(简体)
通过 HTTP 向Solr张贴密码保护文档
原标题:Posting a password-protected document to Solr via HTTP

I want to post a http document that is password protected.
It has a username and password login page before you can access the actual document. I tried doing this

curl 
 -u username:password 
 "http://localhost:8983/solr/update/extract?literal.id=doc900&commit=true" 
 -F stream.url=http://somewebsite.com/docs/DOC2609

但它只是将登录页面索引化而已。

最佳回答

我猜你使用的这个页面的认证方法 并不是 HTTP 的认证方法之一 卷曲支持的外框。

HTTP认证是最基本的,有些人可能认为是微不足道的,而且其最基本的形式(从字面上说,基本模式 HTTP认证将用户密码以简单文本发送到电线上,作为请求信头之一)基本上没有保障。 我只看到它与HTTPS一起使用,甚至这些日子也很少见。

HTTP认证通常不利于HTTP PUT或POST对HTPS的请求,通常以某种跨地点请求伪造(CSRF)预防措施或AUSTTH2战略(通常将问题交由认证经纪人执行)加以强化。

您的问题是, curl 并不知道这些。 如果您在 Python 中的程序, 您可能会发现 < code> 请求 软件包有帮助( 在设计启动时比 curl 更现代 ) 。 Sorr 如果您正确调用它的 HTTP API, 则不管用哪一种方式都不管 。

问题回答

暂无回答




相关问题
ajax login using httpRequest?

I am trying to develop my login script to give feedback to the user if the login is valid or not. Basically if it isn t correct a div box will show saying its wrong, if its correct it will show its ...

Remotely authenticating client Windows user on demand

Suppose I am writing a server for a particular network protocol. If I know that the client is running on a Windows machine, is it possible for my server to authenticate the Windows user that owns the ...

Role/Permission based forms authorizing/authentication?

While looking into forms authorizing/authentication, I found that it is possible to do role based authorizing by adding an array of roles to a FormsAuthenticationTicket. That way I can write User....

热门标签