[7.4.1] HttpRequest>>username:password: gone?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[7.4.1] HttpRequest>>username:password: gone?

Boris Popov, DeepCove Labs (SNN)
Looks like HttpRequest>>username:password: is gone from 7.4.1 so this code
no longer works,

(req := HttpRequest new)
          method: 'method' url: 'someurl';
          username: 'user' password: 'password';
          contents: 'contents'.
HttpClient new executeRequest: req

I could go through with a rewrite editor and modify every occurrence to set
the credentials on the client instead, but was hoping there's some backward
compatibility available that I can't see at the moment.

Thanks!

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: [7.4.1] HttpRequest>>username:password: gone?

Boris Popov, DeepCove Labs (SNN)
Tamara was kind enough to follow up on the issue outside of the list and
here's a quick summary of what we settled on. Indeed the protocol is no
longer supported on the http request and username/password should be set on
the http client instead. Backward compatibility is tricky to do, so I ended
up using a rewrite tool to fix up our code. The reason its not as scary as
it sounds is due to the fact that 7.4 already supports the http client
protocol, so our code that currently runs in 7.4 will continue to work even
with the changes as well as port transparently over to 7.4.1 once its
released.

Cheers!

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

-----Original Message-----
From: Boris Popov [mailto:[hidden email]]
Sent: Monday, June 12, 2006 8:40 AM
To: vwnc
Subject: [7.4.1] HttpRequest>>username:password: gone?

Looks like HttpRequest>>username:password: is gone from 7.4.1 so this code
no longer works,

(req := HttpRequest new)
          method: 'method' url: 'someurl';
          username: 'user' password: 'password';
          contents: 'contents'.
HttpClient new executeRequest: req

I could go through with a rewrite editor and modify every occurrence to set
the credentials on the client instead, but was hoping there's some backward
compatibility available that I can't see at the moment.

Thanks!

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

HTTP OPTIONS

Paul Adamczyk
Hello,

HttpRequest class does not support all messages of
HTTP/1.1.  It would appear trivial to add them, except
for the following case (RFC 2616, sect. 5.1.2):

OPTIONS * HTTP/1.1

VW 7.4 does not seem to provide an easy way to set
Request-URI to "*" and all my hacking attempts so far
have failed.  I can set it to "/*" but that's not good
enough.  Has anyone implemented this version of
OPTIONS message?  Or is there a documentation that
explains how to go about adding this flavor of
Request-URI to VW?

Thank you,

Paul Adamczyk


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 

Reply | Threaded
Open this post in threaded view
|

RE: HTTP OPTIONS

Kogan, Tamara
The case when the Request-URI can be the asterisk "*" has not
implemented.

You can try to create a subclass from the HttpRequestLine.
Smalltalk.Net defineClass: #HttpRequestLineOptions
        superclass: #{Net.HttpRequestLine}

with a few methods:

HttpRequestLineOptions>>hostAndPort
        ^(self url notNil and: [self url ~= '*'])
                ifTrue: [self url asURI hostAndPort ]
                ifFalse: [ nil ]

HttpRequestLineOptions>>url: anURL
        url := anURL

HttpRequestLineOptions>>printOn: aStream

        aStream nextPutAll: self extendedMethod;space.
        self url = '*'
                ifTrue: [aStream nextPutAll: '*']
                ifFalse: [aStream nextPutAll: self pathString].
        aStream
                space;
                nextPutAll: self version.

To create the OPTIONS method:

r := HttpRequest new.
l := HttpRequestLineOptions method: 'OPTIONS' url: '*'.
r messageLine: l.
r host: 'www.myserver'.
r printString inspect

I hope it helps,
Tamara Kogan
Smalltalk Development
Cincom Systems

> -----Original Message-----
> From: Paul Adamczyk [mailto:[hidden email]]
> Sent: Tuesday, June 13, 2006 12:40 AM
> To: vwnc
> Subject: HTTP OPTIONS
>
> Hello,
>
> HttpRequest class does not support all messages of
> HTTP/1.1.  It would appear trivial to add them, except
> for the following case (RFC 2616, sect. 5.1.2):
>
> OPTIONS * HTTP/1.1
>
> VW 7.4 does not seem to provide an easy way to set
> Request-URI to "*" and all my hacking attempts so far
> have failed.  I can set it to "/*" but that's not good
> enough.  Has anyone implemented this version of
> OPTIONS message?  Or is there a documentation that
> explains how to go about adding this flavor of
> Request-URI to VW?
>
> Thank you,
>
> Paul Adamczyk
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com