Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sat Oct 20, 2018 10:35 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: How to respond to an Expect:100-Continue
PostPosted: Thu Jul 05, 2012 3:57 pm 
Offline

Joined: Sat Aug 30, 2008 2:20 pm
Posts: 90
Location: Barcelona, Spain
I have a small web application made using ServerSocket/TCPSocket that serves several dynamic html pages.

Now I need to increase the functionality communicating with a .NET web service that will POST data to my web application.

This .NET web service uses HTTP/1.1 Expect/Continue, so I understand that I must respond accordingly to it.

The inital headers that I am receiving when the .Net service tries to communicate with my web application are:

POST /addItem?authorization=RG9jdGFODTTiQ%3d HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Host: mydomain.com:8080
Content-Length: 141
Expect: 100-continue
Connection: Keep-Alive


As you can see, some part of the request comes as a parameter (authorization), and all other information needed will come when receiving the full request.

I am not an expert in this matter, but I know I need to respond for having the .NET web service send the full request information, so I prepared a hard coded response with the following, and then keep waiting in the loop waiting to receive the response.

sTx = "HTTP/1.1 100 Continue" + httpserver.CRLF
sTx = sTx + "Server: ArchiMED" + httpserver.crlf
sTx = sTx + httpserver.crlf
Me.Write sTx


But what I get is an error from the web service with the following:

JSON Parsing: ERROR - Empty response
RESPONSE:

So, what I want to know is how can I hard code and send a response to the Expect/Continue protocol


Top
 Profile  
Reply with quote  
 Post subject: Re: How to respond to an Expect:100-Continue
PostPosted: Sat Jul 07, 2012 2:40 am 
Offline
User avatar

Joined: Mon Apr 02, 2007 2:08 am
Posts: 1225
Location: San Francisco, CA, USA
HTTP headers end with two CRLF's, but it looks like you're only adding one.

_________________
Boredom Software


Top
 Profile  
Reply with quote  
 Post subject: Re: How to respond to an Expect:100-Continue
PostPosted: Sat Jul 07, 2012 4:59 am 
Offline

Joined: Sat Aug 30, 2008 2:20 pm
Posts: 90
Location: Barcelona, Spain
Hello charnonn0,

There are indeed two CrLf at the end.

"httpserver.crlf" is a variable that contains CrLf.

I have one CrLf at the end of the line "Server: ArchiMED", and another one in the following line.


Top
 Profile  
Reply with quote  
 Post subject: Re: How to respond to an Expect:100-Continue
PostPosted: Sun Aug 05, 2012 5:35 am 
Offline
User avatar

Joined: Fri Oct 28, 2005 7:05 am
Posts: 565
Location: Emsworth, UK
Try this
me.write("HTTP/1.1 100 Continue" + EndOfLine.Windows + EndOfLine.Windows)

Any better?

_________________
Yes it's me in the avatar


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group