[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: http_persist vs http_url



Tony,

It doesn't clarify much -- but now it sounds like the opposite of what you originally asked?

In the HTTP 1.1 protocol, all connections are considered "persistent" by default. The idea is you make one request (its very much like sending a command) and when the request is done, you're left at the point where you can make another request (much like returning to the command line), you can then keep making requests until you're done, at which point you disconnect.

HTTPAPI, therefore provides a set of routines called http_persist_open(), http_persist_xxx (where xxx are the different request types) and http_persist_close(). You can use these to connect, run multiple requests, and then disconnect if desired. This is the "persistent" approach.

The way you're doing it (which is used 90+% of the time) with http_url_xxx is really just a "shortcut" that runs http_persist_open, http_persist_get, and http_persist_close in succession. So under the covers there is no difference between using the http_url APIs and http_persist APIs, UNLESS you want to run multiple requests within a single connection. Running multiple requests is more complicated to code, but can improve performance significantly if you are making a lot of requests in a short time.

However, the functionality is exactly the same. There should not be a situation where http_url_xxx (which calls the http_close routine) can "cause issues with subsequent requests". I've never heard of that before. Unless it's something very specific to the server you're connecting to?

It is possible to use non-persistent HTTP, even though this is unusual in HTTP 1.1, by adding the "Connection: close" header to your request using http_xproc(). But this usually only needed for compatibility with HTTP 1.0, and I haven't seen anyone do that in years.

I find it odd that your service provider would somehow know which APIs you're using and would know anything about what they do. Why do they care which APIs you use?

-SK


On 7/14/2016 12:06 PM, Tony Cate wrote:
    I literally have no idea. The service provider asked that and it makes
    no sense to me. After I had sent my query to you, the service provider
    sent me this:
    The persist may be causing issues as generally you open a connection do
    your work and close the connection and it appears from the debug logs
    that http_close is happening and may be causing issues when making
    further requests.
    I'm not sure that clarifies anything.
    Tony

    On Thu, Jul 14, 2016 at 12:57 PM, Scott Klement
    <[1]sk@xxxxxxxxxxxxxxxx> wrote:

      Tony,
      Sorry, I don't understand what you are asking.�  What is the
      difference in your mind between a "http_persist" and "http_url"
      connection?
      -SK
      On 7/14/2016 11:00 AM, Tony Cate wrote:

      �  �  A service provider sent this request:
      �  �  It also appears from your debug logs you are using a
      http_perisit
      �  �  connection would it be possible to test using a http_url
      connection?
      �  �  Here's my request code:
      �  �  � rc = http_url_get_xml(uri: %paddr(StartXMLNode)
      :%paddr(EndXMLNode):
      �  �  *null);
      �  �  I don't see anything in HTTPAPI_H that helps. Can you explain
      what is
      �  �  being asked and what I have to do to comply?
      �  �  Tony
      �  �  --
      �  �  Tony Cate� |� Senior Programmer/Analyst� |�
      [2]704.872.2458 x 126
      �  �  [1]Auction Edge, Inc.
      �  �  AUCTION� EDGE,� INC.� |� Powering Independent Auctions
      �  �  STATESVILLE, NC� |� [3]704.872.2458
      References
      �  �  1. [4]http://www.auctionedge.com/
      --------------------------------------------------------------------
      ---
      This is the FTPAPI mailing list.�  To unsubscribe, please go to:
      [5]http://www.scottklement.com/mailman/listinfo/ftpapi
      --------------------------------------------------------------------
      ---

      --------------------------------------------------------------------
      ---
      This is the FTPAPI mailing list.�  To unsubscribe, please go to:
      [6]http://www.scottklement.com/mailman/listinfo/ftpapi
      --------------------------------------------------------------------
      ---

    --
    Tony Cate� |� Senior Programmer/Analyst� |� 704.872.2458 x 126
    [7]Auction Edge, Inc.
    AUCTION� EDGE,� INC.� |� Powering Independent Auctions
    STATESVILLE, NC� |� 704.872.2458

References

    1. mailto:sk@xxxxxxxxxxxxxxxx
    2. tel:704.872.2458%20x%20126
    3. tel:704.872.2458
    4. http://www.auctionedge.com/
    5. http://www.scottklement.com/mailman/listinfo/ftpapi
    6. http://www.scottklement.com/mailman/listinfo/ftpapi
    7. http://www.auctionedge.com/



-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------