Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default CFHTTP Question

    If you go to this site it works fine.
    [url]http://forums.agd.org/n/mb/message.asp?webtag=agdSmileline&msg=1736.1[/url] So I
    am trying to GET these in a CFhttp query. Here is my code: <cfhttp url =
    'http://forums.agd.org/n/mb/message.asp?webtag=agdSmileline&amp;msg=1736.1'
    method='get'> But i get a StatusCode of '302 Object moved' How can I get
    this to work? Thank you!

    Vbprog40 Guest

  2. Similar Questions and Discussions

    1. CFHTTP
      Hello, I need to send data from a CF page to an asp.net page for processing via a URL string. The ASP page takes three parameters. Those being...
    2. cfhttp & cfdocument question
      I am working with CFMX7 and the new cfdocumet tag. I have a db search that I would like to export to a PDF doc. So, I have: <!DOCTYPE HTML...
    3. cfhttp erro
      I have been trying to read a tab delimited text file with cfhttp get and I keep getting this error - The column name '<!DOCTYPE HTML PUBLIC...
    4. CFHTTP Get Content
      I am trying to just grab some text from a website using CFHTTP. The code before the text is: <td class=boldText><b> The code after the text is:...
    5. CFHTTP help
      We have an in-house built publication system that creates .htm files from database content. For a specific project, I need to modify the way that...
  3. #2

    Default Re: CFHTTP Question

    If you disable cookies and try to go to that link, you get the same thing (it redirects to a login page).
    Kronin555 Guest

  4. #3

    Default Re: CFHTTP Question

    Have to login first (or just visit the login page), get cookies, and use them in futher requests.

    Mr Black Guest

  5. #4

    Default Re: CFHTTP Question

    If you go to that link it works fine... There are cookies that are being set so
    that maybe the problem...not really sure. You dont have to login anywhere. If
    anyone has any coding sudjections Im all hears. Thank you

    Vbprog40 Guest

  6. #5

    Default Re: CFHTTP Question

    1. You have to login. When you hit that page without appropriate cookie set,
    it re-directs you to:
    [url]http://login.prospero.com/dir-login/clientLogin.asp?webtag=agdSmileline&amp;[/url] .
    .. . <your URL follows> . . . . 'Login' happens here by setting a few
    cookies. And re-directing you back to the original URL. Therefore, whatever
    you think is single HTTP request, it is, in fact, three requests. 2. It
    works in the browser, because browser handles this process for you. To use
    CFHTTP you have to do this on your own. 3. Try your CFHTTP call with this HTTP
    header 'Cookie' set: Cookie: ARPT=JJXRWOS10.0.1.105CKKKU;
    LOGIN=1%7CG%2D41986731%7C1161846927%7C1113704927%7 C1745593155%7CUI41986731%5ENZ1
    %5EAR299%5EFP%2D1%7C1%7Csfp3Az3MSueNUe%2BHG%2BUNnw ;
    ppref=1%7BCD8DC22C%2DAC52%2D41D4%2D9EBF%2D1613BB56 3D33%7DhBpEjSM1FQ266%2B6eTXzRJ
    w%3D%3D You will see that now your CFHTTP works just fine. 4. As about coding
    suggestions, if you under Windows, try this:
    [url]http://www.cftagstore.com/tags/cfxhttp5.cfm[/url]

    Mr Black Guest

  7. #6

    Default Re: CFHTTP Question

    Would love to purchase the CFX_HTTP Script... however this is for a non profit
    group so the budjet is really low. I used this as my code: <cfhttp url =
    'http://forums.agd.org/n/mb/message.asp?webtag=agdSmileline&amp;msg=1736.1'
    method='POST'> <cfhttpparam name = 'ARPT' type = 'Cookie' value =
    'ARPT=JJXRWOS10.0.1.105CKKKU'> <cfhttpparam name = 'LOGIN' type = 'Cookie'
    value =
    '=1%7CG%2D41986731%7C1161846927%7C1113704927%7C174 5593155%7CUI41986731%5ENZ1%5EA
    R299%5EFP%2D1%7C1%7Csfp3Az3MSueNUe%2BHG%2BUNnw'> <cfhttpparam name = 'ppref'
    type = 'Cookie' value =
    'ppref=1%7BCD8DC22C%2DAC52%2D41D4%2D9EBF%2D1613BB5 63D33%7DhBpEjSM1FQ266%2B6eTXzR
    Jw%3D%3D'> </cfhttp> However it still didn't work. Am i doing something
    wrong? Thank you again.

    Vbprog40 Guest

  8. #7

    Default Re: CFHTTP Question

    Perhaps, it doesn't work, because the session expired. Cookie I've posted was
    valid at the moment I typed the message. As I already mentioned, you have two
    options here: Use CFX_HTTP5 that handles cookies and sessions for you (this is
    what we use). Do all the process of 'login' (don't undersand why they do that
    on the Web-site like this) on your own: 1. Create a variable (list or array) to
    store cookies. 2. Issue the first CFHTTP with disabled redirects. 3. If 30x
    code was returned, extract redirection URL, extract cookies. If 200 code
    returned, you done. 4. Add/Replace cookies in your storage variable. 5. Issue
    another CFHTTP to redirection URL with cookies set. 6. Goto (3). As I can see
    from here, your case requires three CFHTTP calls to extract the target page.

    Mr Black Guest

  9. #8

    Default CFHTTP Question

    Hello,
    I never used CFHTTP in a "real" situation before, but now I think this the
    perfect time to do so. But I am running into a problem, I am trying to send an
    SMS message through an aggregator. The code is below, but I do not want my
    action page to be the action page that the guy emailed to me, since I am
    running other code as well, like inserts, etc I would like to just cfhttp the
    information the the page that was set up for me. Am I missing anything? When I
    try using the action page by itself, it DOES work. Just not through cfhttp.

    Any help would be appreciated.

    --
    Frank

    <!--- Code Emailed To Me Below --->

    <form method="POST"
    action="http://www.- - - - - - -.com/sms/sending.php">

    <p>Enter phone number to send the message to: <input
    type="text" name="PhoneNumber" size="11"</p>
    <p>Type in your message:</p>
    <p><input type="text" name="TextMessage"
    size="50"><p>
    <p><input type="submit" value="Submit"
    name="B1"></p>
    </form>

    <!--- My CF code --->
    <cfhttp method="post" url="http://www.- - - - - - -.com/sms/sending.php">
    <cfhttpparam type="formfield" name="textmessage" value="This is a test">
    <cfhttpparam type="formfield" name="PhoneNumber" value="5555555555">
    <cfhttpparam type="formfield" name="B1" value="Submit">
    </cfhttp>

    Frank D'Elia Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139