Results 1 to 6 of 6
  1. #1
    pavan528 is offline Member
    Join Date
    Sep 2012
    Posts
    13
    Rep Power
    0

    Default Using HTTP Requests for Sockets instead of TCP

    Hi all,
    Generally Socket Programming uses HTTP Protocol to send and receive messages in Java. Can we try to exchange HTTP/HTTPS requests instead of TCP?

    a Socket constructs a HTTP request to send to another socket from information it has and sends to another one and Server responds with HTTPResponse.

    Thanks,

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,399
    Rep Power
    25

    Default Re: Using HTTP Requests for Sockets instead of TCP

    Did you have a java programming question?
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    pavan528 is offline Member
    Join Date
    Sep 2012
    Posts
    13
    Rep Power
    0

    Default Re: Using HTTP Requests for Sockets instead of TCP

    Yes, Actually I know how to code Normal Socket Programming. But not sure if http is possible in Sockets in Java . If yes, Can someone kidly redirect me to few examples or materials that does so?

  4. #4
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,399
    Rep Power
    25

    Default Re: Using HTTP Requests for Sockets instead of TCP

    Most of the contents of HTTP is just text and newline characters that are sent using Sockets.
    Read the RFC about HTTP for a description of how to format the text.
    Do an internet search.
    If you don't understand my response, don't ignore it, ask a question.

  5. #5
    SurfMan's Avatar
    SurfMan is online now Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    946
    Rep Power
    2

    Default Re: Using HTTP Requests for Sockets instead of TCP

    TCP != HTTP

    HTTP is a protocol that runs on top of TCP/IP. (To be exact: HTTP is layer 7, TCP is layer 4 and IP is layer 3 in the OSI model). You can't replace one by the other.
    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2 2013

  6. #6
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,998
    Rep Power
    5

    Default Re: Using HTTP Requests for Sockets instead of TCP

    Quote Originally Posted by Norm View Post
    Do an internet search.
    So you would apply the HTTP protocol (under water) to find information about the HTTP protocol... God I love ICT.

    Actually I know how to code Normal Socket Programming
    I believe you, but the important thing is to understand, and that you do not. You need to research this topic outside of the scope of Java. The RFC ("Request For Comment") Norm mentions is a good start, but I would also read up about TCP/IP.

    Hypertext Transfer Protocol -- HTTP/1.1
    Last edited by gimbal2; 04-11-2014 at 08:43 PM.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

Similar Threads

  1. A Multithreaded HTTP Server using Sockets in Java
    By zameer in forum Reviews / Advertising
    Replies: 1
    Last Post: 05-30-2011, 06:51 PM
  2. HTTP POST over sockets
    By DC200 in forum Networking
    Replies: 2
    Last Post: 09-19-2010, 03:00 PM
  3. GET Requests
    By CoderMan in forum Java Applets
    Replies: 1
    Last Post: 05-13-2010, 10:11 PM
  4. HTTP requests through proxy server
    By manolowar in forum Networking
    Replies: 3
    Last Post: 01-20-2009, 04:52 AM
  5. Removal of Homework Requests
    By CaptainMorgan in forum Suggestions & Feedback
    Replies: 14
    Last Post: 08-03-2008, 09:21 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •