Archived Forum Post

Index of archived forum posts

Question:

Twitter geocode search problem

Nov 21 '14 at 10:13

I'm really battling with twitters search api when trying to searches with a location

normal searches work fine and as i'm unable to find any references on the internet to the same problem i'm beginning to wonder if it is to do with the URL encoding of a comma (or lack there of)

Having sucessfully done an oAuth logon if I do this ......

https://api.twitter.com/1.1/search/tweets.json?count=5&q=villa&result_type=mixed .... I get the result I expect

https://api.twitter.com/1.1/search/tweets.json?count=5&q=villa&result_type=mixed&geocode=52.4122184,-1.51077609999993,100mi ... I get error 401

If I encode %2C into the string itself and then let it double encode https://api.twitter.com/1.1/search/tweets.json?count=5&q=villa&result_type=mixed&geocode=52.4122184%252C-1.51077609999993%252C100mi .... the call works .... but I get an empty result set (almost 0% chance of that being correct)

If I encode %2C into the string itself and DONT double encode https://api.twitter.com/1.1/search/tweets.json?count=5&q=villa&result_type=mixed&geocode=52.4122184%252C-1.51077609999993%252C100mi .... I get error 401

Thanks in advance


Answer

Thanks for the speedy response hopefully this answers everything below .....

I'm using 9.5.0

I'm using QuickGetStr

At the point at which it is called if the sCallString contains

https://api.twitter.com/1.1/search/tweets.json?count=5&q=iphone6&result_type=mixed&geocode=51.5185614,-0.14379910000002383,30mi

I get error 401

If sCallstring contains this

https://api.twitter.com/1.1/search/tweets.json?count=5&q=iphone6&result_type=mixed&geocode=51.5185614%252C-0.14379910000002383%252C30mi

I get a proper success response from Twitter but the result set is empty (probably because double encoding the comma has made the geocode invalid at their end

The passed in struct contains the following data

sKey         sValue
count        5
q            iphone6
result_type  mixed
geocode      51.5185614,-0.14379910000002383,30mi or 51.5185614%2C-0.14379910000002383%2C30mi depending on test call

My code for sending this is (note VerifyCredentials just calls this same routine again passing empty taCallParams)

Function MakeTwitterGetCall String sCallString tdTwitterCallParams[] taCallParams Returns tdTwitterErrorStatus
    Variant vRespCOMObj
    tdTwitterErrorStatus tTwitterErrorStatus
    Boolean bOK
    Handle hoHTTP hoHTTPResp
    String sOAuthToken sOAuthConsumerKey sOAuthConsumerSecret sOAuthTokenSecret
    Integer iSOA iLoop

    Get psOAuthToken to sOAuthToken

    If (Length(sOAuthToken)>0) Begin 
        If (not(pbCallingVerifyCredentials(Self))) Begin
            Get VerifyCredentials to tTwitterErrorStatus
        End
        Else Begin
            Move True to tTwitterErrorStatus.bSuccess
        End
        If (tTwitterErrorStatus.bSuccess) Begin 
            Get Create (RefClass(cComChilkatHttp)) to hoHTTP
            Get Create (RefClass(cComChilkatHttpResponse)) to hoHTTPResp

            Get psOAuthConsumerKey to sOAuthConsumerKey
            Get psOAuthConsumerSecret to sOAuthConsumerSecret
            Get psOAuthTokenSecret to sOAuthTokenSecret

            Get ComUnlockComponent      of hoHTTP UNLOCK_CHILKAT_HTTP to bOK
            Set ComOAuth1               of hoHTTP to 1
            // BVDdM9WoN1Q46Qwjs5K1cl4kE  
            Set ComOAuthConsumerKey     of hoHTTP to (psOAuthConsumerKey(Self)) 
            // 8nRwW4KrwhiVhulTx1Q44ZJk1UBhyj4K7q1WksP3W5nNUGgVqq
            Set ComOAuthConsumerSecret  of hoHTTP to (psOAuthConsumerSecret(Self))    
            // 757341968-zNVtFeVAQNJin04TLub0cPEFJxz0A2o9w6ZEWq0K
            Set ComOAuthToken           of hoHTTP to (psOAuthToken(Self))
            // gmnn0LLQWrWWhJ08ua8hLNM0o1B01IGtBXmczf5oIAzbZ
            Set ComOAuthTokenSecret     of hoHTTP to (psOAuthTokenSecret(Self))
            Set ComVerboseLogging       of hoHTTP to 1
            Set ComSessionLogFilename   of hoHTTP to "C:\xxxxxxxxxxxxxx\twittersearch.log"

            Move (SizeOfArray(taCallParams)-1) to iSOA        
            If (iSOA>-1) Begin
                Move (sCallString+'?') to sCallString
                For iLoop from 0 to iSOA
                    Get ComUrlEncode of hoHTTP taCallParams[iLoop].sKey   to taCallParams[iLoop].sKey
                    Get ComUrlEncode of hoHTTP taCallParams[iLoop].sValue to taCallParams[iLoop].sValue
                    Move (sCallString+taCallParams[iLoop].sKey+'='+taCallParams[iLoop].sValue+'&') to sCallString
                Loop
                Move (Left(sCallString,Length(sCallString)-1)) to sCallString
            End

            Get ComQuickGetObj          of hoHTTP sCallString to vRespCOMObj

            Get TestErrorStatusOfLastResponseObjectCall vRespCOMObj hoHTTP hoHTTPResp to tTwitterErrorStatus

            Send Destroy of hoHTTP
            Send Destroy of hoHTTPResp
        End
    End

    Function_Return tTwitterErrorStatus
End_Function

If the call that gives me the 401 error response I get the following last error and session log. Notice the call to verify_credentials succeeds

---- Sending ----
GET /1.1/account/verify_credentials.json HTTP/1.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0
Accept-Language: en-us,en;q=0.5
Authorization: OAuth oauth_signature_method="HMAC-SHA1", oauth_consumer_key="BVDdM9WoN1Q46Qwjs5K1cl4kE", oauth_token="757341968-zNVtFeVAQNJin04TLub0cPEFJxz0A2o9w6ZEWq0K", oauth_signature="EezZKPBM5HL8YFR9KTvqvv8WDNE%3D", oauth_timestamp="1415184393", oauth_nonce="hQYugMcVtoIjozIDyahGQTmM2Hg%3D", oauth_callback="oob", oauth_version="1.0"
Accept-Encoding: gzip
Host: api.twitter.com

---- Received ----
HTTP/1.1 200 OK
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0
content-encoding: gzip
content-length: 741
content-type: application/json;charset=utf-8
date: Wed, 05 Nov 2014 10:46:33 UTC
expires: Tue, 31 Mar 1981 05:00:00 GMT
last-modified: Wed, 05 Nov 2014 10:46:33 GMT
pragma: no-cache
server: tsa_b
set-cookie: lang=en
set-cookie: guest_id=v1%3A141518439364284692; Domain=.twitter.com; Path=/; Expires=Fri, 04-Nov-2016 10:46:33 UTC
status: 200 OK
strict-transport-security: max-age=631138519
x-access-level: read-write-directmessages
x-connection-hash: 09c880e89c91a99332c4f6e2730925b0
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-rate-limit-limit: 15
x-rate-limit-remaining: 13
x-rate-limit-reset: 1415185097
x-transaction: dd9be85893b22cd8
x-xss-protection: 1; mode=block

‹       ¬UKoÛ0þ+†®ËÛyÖÀÝÒb·C±Ë<²M;Bd)“ä¦]‘ÿ>ʏؙ›aêK)R|è…ðŒDëåz¾nV›  ŠÔXM"rÆÈ„HVB߶÷Þ‹ˆI5€¤­âv*D…J™åJ"„ÒA«œ =*+!&$´æ‡žXiÑé@Zn9½\ò^áï?N§Úµ…ÔÆž3a`Br%„:‚64U•´$òÓdvF 7h4 `Ì!EòPw[^°ð‚eúQxã½óñóB?1Ðœ=ªJsÃS*›R•çP|?_!}B,/þRÒ]Îgvdœ£uŠ‚d‰„ýšç| Ëleúô&˜,ÐHÒéÝ}ŒBÿ’Ú:ô š¯#Õ‡¾ “ºÌË0¸Ùlü•¿^­çaá Þc%ZYxrÞ¿B†1dÆÛB©\x©Ë-®|ž2o§!ÿ“µ‡(žÅ³ãñ8Í”T:ð4MUOƒ@ŠTM¥âÆ°q\K5ŽâkPw´®dʆ%æ’j8ˆgjm®º¬šÆyUÙ¤6&àë+¶­êšåEß7j,k÷7UJg\bÔ¦ƒ‚¥Ðë¥Õ<©¬Òg‚{°Ã¶Å.sM6€†c±cfgYQÏ–â¹L”h…:øÒ‘•ì njz¿ý¶g¾ÕN—áŽ:—j5“F0T¿†b#£n%$,ÝÓs³(œ=ùäoïî¶äU/Y´^}±ÄLí‘—EÝ_³šcâ™ÝAyþ
âYRL˜ÓßýRçÕ´ÞÍ[¹·(Rÿ—\Œåéþ9že³JXzakÆø’⨕Lüʤ÷F'
.÷çŠúþfñq1ОAÂ4MpJ°Q¯V¾ã¡ ά-’îW–ÛMgí¼þZ…Q¥I„KÜt‘ÌøÒ¦ÙZÜMÇÅ‹ƒ«ág…Œp³Úꤲ¸Ö›gÏ´èé7   ÿÿ ¼1{Âl  
---- Sending ----
GET /1.1/search/tweets.json?count=5&q=iphone6&result_type=mixed&geocode=51.5185614,-0.14379910000002383,30mi HTTP/1.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0
Accept-Language: en-us,en;q=0.5
Authorization: OAuth oauth_signature_method="HMAC-SHA1", oauth_consumer_key="BVDdM9WoN1Q46Qwjs5K1cl4kE", oauth_token="757341968-zNVtFeVAQNJin04TLub0cPEFJxz0A2o9w6ZEWq0K", oauth_signature="t9O48fPitehPT3B5sGL1gxUoTrw%3D", oauth_timestamp="1415184395", oauth_nonce="twz57aCzuYsvIsEVfIIkm%2BWN1Uc%3D", oauth_callback="oob", oauth_version="1.0"
Accept-Encoding: gzip
Host: api.twitter.com

---- Received ----
HTTP/1.1 401 Authorization Required
content-encoding: gzip
content-length: 88
content-type: application/json;charset=utf-8
date: Wed, 05 Nov 2014 10:46:35 UTC
server: tsa_b
set-cookie: guest_id=v1%3A141518439534835826; Domain=.twitter.com; Path=/; Expires=Fri, 04-Nov-2016 10:46:35 UTC
strict-transport-security: max-age=631138519
x-connection-hash: 568cfe7788062e7a3319a2178e1a07e9

‹       ªVJ-*Ê/*V²Š®VÊM-.NLOU²RrÎ/ÍIQÈË/QH,-ÉHÍ+ÉLN,IU¨Ì/UÒQJÎOª16ª­   ÿÿ ¾VÈ?

ChilkatLog:
  QuickGetObj:
    DllDate: Aug 24 2014
    ChilkatVersion: 9.5.0.43
    UnlockPrefix: CAREDAHttp
    Username: CM-101220-PC:Andrew
    Architecture: Little Endian; 32-bit
    Language: ActiveX
    VerboseLogging: 1
    quickRequestDb:
      url: https://api.twitter.com/1.1/search/tweets.json?count=5&q=iphone6&result_type=mixed&geocode=51.5185614,-0.14379910000002383,30mi
      sessionLogFilename: C:\Users\andrew.CMAC\Documents\twittersearch.log
      a_quickReq:
        quickHttpRequest:
          httpVerb: GET
          url: https://api.twitter.com/1.1/search/tweets.json?count=5&q=iphone6&result_type=mixed&geocode=51.5185614,-0.14379910000002383,30mi
          openHttpConnection:
            Opening connection directly to HTTP server.
            httpHostname: api.twitter.com
            httpPort: 443
            ssl: 1
            bUsingHttpProxy: 0
            httpProxyAuthMethod: 
            socket2Connect:
              connect2:
                hostname: api.twitter.com
                port: 443
                ssl: 1
                connectImplicitSsl:
                  connectSocket:
                    domainOrIpAddress: api.twitter.com
                    port: 443
                    connectTimeoutMs: 20000
                    connect_ipv6_or_ipv4:
                      Multi-threaded domain to IP address resolution
                      AddrInfoList:
                        AddrInfo:
                          ai_flags: 0
                          ai_family: 2
                          ai_socktype: 0
                          ai_protocol: 0
                          ai_addrlen: 16
                          ai_canonname: (NULL)
                        --AddrInfo
                        AddrInfo:
                          ai_flags: 0
                          ai_family: 2
                          ai_socktype: 0
                          ai_protocol: 0
                          ai_addrlen: 16
                          ai_canonname: (NULL)
                        --AddrInfo
                        AddrInfo:
                          ai_flags: 0
                          ai_family: 2
                          ai_socktype: 0
                          ai_protocol: 0
                          ai_addrlen: 16
                          ai_canonname: (NULL)
                        --AddrInfo
                        AddrInfo:
                          ai_flags: 0
                          ai_family: 2
                          ai_socktype: 0
                          ai_protocol: 0
                          ai_addrlen: 16
                          ai_canonname: (NULL)
                        --AddrInfo
                      --AddrInfoList
                      connecting to IPV4 address...
                      ipAddress: 199.16.156.72
                      connect:
                        Waiting for the connect to complete...
                        myIP: 10.0.0.34
                        myPort: 49765
                        socket connect successful.
                      --connect
                    --connect_ipv6_or_ipv4
                  --connectSocket
                  clientHandshake:
                    clientHandshake2:
                      processHandshakeRecord:
                        processHandshakeMessage:
                          processServerHello:
                            HelloExtension: renegotiation_info
                            HelloExtensionLen: 1
                          --processServerHello
                        --processHandshakeMessage
                      --processHandshakeRecord
                      processHandshakeRecord:
                        processHandshakeMessage:
                          processIncomingCertificates:
                            loadX509DerAlt:
                              success: 1
                            --loadX509DerAlt
                            loadX509DerAlt:
                              success: 1
                            --loadX509DerAlt
                          --processIncomingCertificates
                        --processHandshakeMessage
                      --processHandshakeRecord
                    --clientHandshake2
                  --clientHandshake
                  checkServerCert:
                    Not verifying server certificate...
                    Set the RequireSslCertVerify property to enable verification.
                  --checkServerCert
                  Secure Channel Established.
                --connectImplicitSsl
              --connect2
            --socket2Connect
            connectElapsedMs: 608
            HTTP connection succeeded.
          --openHttpConnection
          buildQuickRequest:
            genStartLine:
              Adding params to the start line...
              startLine: GET /1.1/search/tweets.json?count=5&q=iphone6&result_type=mixed&geocode=51.5185614,-0.14379910000002383,30mi HTTP/1.1
            --genStartLine
            getMimeHeaderHttp:
              headerField: Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
              headerField: Connection: keep-alive
              headerField: User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0
              headerField: Accept-Language: en-us,en;q=0.5
            --getMimeHeaderHttp
            addOAuth1Header:
              oauth_timestamp: 1415184395
              oauth_nonce: twz57aCzuYsvIsEVfIIkm+WN1Uc=
              oauth_consumer_key: BVDdM9WoN1Q46Qwjs5K1cl4kE
              oauth_callback: oob
              oauth_signature_method: HMAC-SHA1
              fullUrl: https://api.twitter.com/1.1/search/tweets.json?count=5&q=iphone6&result_type=mixed&geocode=51.5185614,-0.14379910000002383,30mi
              uriQueryParams:
                paramName: count
                paramName: q
                paramName: result_type
                paramName: geocode
              --uriQueryParams
              No HTTP request entity-body params...
            --addOAuth1Header
            sortedParams:
              oauth_hdr: count
              oauth_hdr: geocode
              oauth_hdr: oauth_callback
              oauth_hdr: oauth_consumer_key
              oauth_hdr: oauth_nonce
              oauth_hdr: oauth_signature_method
              oauth_hdr: oauth_timestamp
              oauth_hdr: oauth_token
              oauth_hdr: oauth_version
              oauth_hdr: q
              oauth_hdr: result_type
            --sortedParams
            baseStringURI: https://api.twitter.com/1.1/search/tweets.json
            baseStringURI_encoded: https%3A%2F%2Fapi.twitter.com%2F1.1%2Fsearch%2Ftweets.json
            normalizedParams: count=5&geocode=51.5185614,-0.14379910000002383,30mi&oauth_callback=oob&oauth_consumer_key=BVDdM9WoN1Q46Qwjs5K1cl4kE&oauth_nonce=twz57aCzuYsvIsEVfIIkm%2BWN1Uc%3D&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1415184395&oauth_token=757341968-zNVtFeVAQNJin04TLub0cPEFJxz0A2o9w6ZEWq0K&oauth_version=1.0&q=iphone6&result_type=mixed
            normalizedParams_encoded: count%3D5%26geocode%3D51.5185614,-0.14379910000002383,30mi%26oauth_callback%3Doob%26oauth_consumer_key%3DBVDdM9WoN1Q46Qwjs5K1cl4kE%26oauth_nonce%3Dtwz57aCzuYsvIsEVfIIkm%252BWN1Uc%253D%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1415184395%26oauth_token%3D757341968-zNVtFeVAQNJin04TLub0cPEFJxz0A2o9w6ZEWq0K%26oauth_version%3D1.0%26q%3Diphone6%26result_type%3Dmixed
            signatureBaseString: GET&https%3A%2F%2Fapi.twitter.com%2F1.1%2Fsearch%2Ftweets.json&count%3D5%26geocode%3D51.5185614,-0.14379910000002383,30mi%26oauth_callback%3Doob%26oauth_consumer_key%3DBVDdM9WoN1Q46Qwjs5K1cl4kE%26oauth_nonce%3Dtwz57aCzuYsvIsEVfIIkm%252BWN1Uc%253D%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1415184395%26oauth_token%3D757341968-zNVtFeVAQNJin04TLub0cPEFJxz0A2o9w6ZEWq0K%26oauth_version%3D1.0%26q%3Diphone6%26result_type%3Dmixed
            oauth_signature: t9O48fPitehPT3B5sGL1gxUoTrw=
          --buildQuickRequest
          addCookies:
            Not auto-adding cookies.
          --addCookies
        --quickHttpRequest
        requestHeader:
          requestHeader: GET /1.1/search/tweets.json?count=5&q=iphone6&result_type=mixed&geocode=51.5185614,-0.14379910000002383,30mi HTTP/1.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0
Accept-Language: en-us,en;q=0.5
Authorization: OAuth oauth_signature_method="HMAC-SHA1", oauth_consumer_key="BVDdM9WoN1Q46Qwjs5K1cl4kE", oauth_token="757341968-zNVtFeVAQNJin04TLub0cPEFJxz0A2o9w6ZEWq0K", oauth_signature="t9O48fPitehPT3B5sGL1gxUoTrw%3D", oauth_timestamp="1415184395", oauth_nonce="twz57aCzuYsvIsEVfIIkm%2BWN1Uc%3D", oauth_callback="oob", oauth_version="1.0"
Accept-Encoding: gzip
Host: api.twitter.com
        --requestHeader
        sendRequestHeader:
          sendHeaderElapsedMs: 16
        --sendRequestHeader
        readResponseHeader:
          responseHeader: HTTP/1.1 401 Authorization Required
content-encoding: gzip
content-length: 88
content-type: application/json;charset=utf-8
date: Wed, 05 Nov 2014 10:46:35 UTC
server: tsa_b
set-cookie: guest_id=v1%3A141518439534835826; Domain=.twitter.com; Path=/; Expires=Fri, 04-Nov-2016 10:46:35 UTC
strict-transport-security: max-age=631138519
x-connection-hash: 568cfe7788062e7a3319a2178e1a07e9

        --readResponseHeader
        statusCode: 401
        statusText: Authorization Required
        readResponseBody:
          contentLength: 88
        --readResponseBody
      --a_quickReq
      computeAuthorization:
        No useful WWW-Authenticate response header was found.
      --computeAuthorization
      computeAuthorization failed (3).
    --quickRequestDb
  --QuickGetObj
  Success.
--ChilkatLog

For the successful but fruitless call I getthis session log

---- Sending ----
GET /1.1/account/verify_credentials.json HTTP/1.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0
Accept-Language: en-us,en;q=0.5
Authorization: OAuth oauth_signature_method="HMAC-SHA1", oauth_consumer_key="BVDdM9WoN1Q46Qwjs5K1cl4kE", oauth_token="757341968-zNVtFeVAQNJin04TLub0cPEFJxz0A2o9w6ZEWq0K", oauth_signature="Bf42TJJiESm539EH0LcAHbY0j60%3D", oauth_timestamp="1415184197", oauth_nonce="hdM4P70fct7hW%2FVI7Hg8tEZZBPw%3D", oauth_callback="oob", oauth_version="1.0"
Accept-Encoding: gzip
Host: api.twitter.com

---- Received ----
HTTP/1.1 200 OK
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0
content-encoding: gzip
content-length: 741
content-type: application/json;charset=utf-8
date: Wed, 05 Nov 2014 10:43:17 UTC
expires: Tue, 31 Mar 1981 05:00:00 GMT
last-modified: Wed, 05 Nov 2014 10:43:17 GMT
pragma: no-cache
server: tsa_b
set-cookie: lang=en
set-cookie: guest_id=v1%3A141518419763481900; Domain=.twitter.com; Path=/; Expires=Fri, 04-Nov-2016 10:43:17 UTC
status: 200 OK
strict-transport-security: max-age=631138519
x-access-level: read-write-directmessages
x-connection-hash: 27404ed0b404282b46e0f9449449ce12
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-rate-limit-limit: 15
x-rate-limit-remaining: 14
x-rate-limit-reset: 1415185097
x-transaction: 26d028bc4a69665e
x-xss-protection: 1; mode=block

‹       ¬UKoÛ0þ+†®ËÛyÖÀÝÒb·C±Ë<²M;Bd)“ä¦]‘ÿ>ʏؙ›aêK)R|è…ðŒDëåz¾nV›  ŠÔXM"rÆÈ„HVB߶÷Þ‹ˆI5€¤­âv*D…J™åJ"„ÒA«œ =*+!&$´æ‡žXiÑé@Zn9½\ò^áï?N§Úµ…ÔÆž3a`Br%„:‚64U•´$òÓdvF 7h4 `Ì!EòPw[^°ð‚eúQxã½óñóB?1Ðœ=ªJsÃS*›R•çP|?_!}B,/þRÒ]Îgvdœ£uŠ‚d‰„ýšç| Ëleúô&˜,ÐHÒéÝ}ŒBÿ’Ú:ô š¯#Õ‡¾ “ºÌË0¸Ùlü•¿^­çaá Þc%ZYxrÞ¿B†1dÆÛB©\x©Ë-®|ž2o§!ÿ“µ‡(žÅ³ãñ8Í”T:ð4MUOƒ@ŠTM¥âÆ°q\K5ŽâkPw´®dʆ%æ’j8ˆgjm®º¬šÆyUÙ¤6&àë+¶­êšåEß7j,k÷7UJg\bÔ¦ƒ‚¥Ðë¥Õ<©¬Òg‚{°Ã¶Å.sM6€†c±cfgYQÏ–â¹L”h…:øÒ‘•ì njz¿ý¶g¾ÕN—áŽ:—j5“F0T¿†b#£n%$,ÝÓs³(œ=ùäoïî¶äU/Y´^}±ÄLí‘—EÝ_³šcâ™ÝAyþ
âYRL˜ÓßýRçÕ´ÞÍ[¹·(Rÿ—\Œåéþ9že³JXzakÆø’⨕Lüʤ÷F'
.÷çŠúþfñq1ОAÂ4MpJ°Q¯V¾ã¡ ά-’îW–ÛMgí¼þZ…Q¥I„KÜt‘ÌøÒ¦ÙZÜMÇÅ‹ƒ«ág…Œp³Úꤲ¸Ö›gÏ´èé7   ÿÿ ¼1{Âl  
---- Sending ----
GET /1.1/search/tweets.json?count=5&q=iphone6&result_type=mixed&geocode=51.5185614%252C-0.14379910000002383%252C30mi HTTP/1.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0
Accept-Language: en-us,en;q=0.5
Authorization: OAuth oauth_signature_method="HMAC-SHA1", oauth_consumer_key="BVDdM9WoN1Q46Qwjs5K1cl4kE", oauth_token="757341968-zNVtFeVAQNJin04TLub0cPEFJxz0A2o9w6ZEWq0K", oauth_signature="QJYWESGFh6Qc6T4jLaKgSu9ibkM%3D", oauth_timestamp="1415184202", oauth_nonce="6yib6n2Dq8YhgTjemUIzuiapOYA%3D", oauth_callback="oob", oauth_version="1.0"
Accept-Encoding: gzip
Host: api.twitter.com

---- Received ----
HTTP/1.1 200 OK
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0
content-encoding: gzip
content-length: 240
content-type: application/json;charset=utf-8
date: Wed, 05 Nov 2014 10:43:22 UTC
expires: Tue, 31 Mar 1981 05:00:00 GMT
last-modified: Wed, 05 Nov 2014 10:43:22 GMT
pragma: no-cache
server: tsa_b
set-cookie: lang=en
set-cookie: guest_id=v1%3A141518420248582831; Domain=.twitter.com; Path=/; Expires=Fri, 04-Nov-2016 10:43:22 UTC
status: 200 OK
strict-transport-security: max-age=631138519
x-access-level: read-write-directmessages
x-connection-hash: ab090426bf51e05117db226568a82fab
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-rate-limit-limit: 180
x-rate-limit-remaining: 178
x-rate-limit-reset: 1415184437
x-transaction: 336e40d3f1af6360
x-xss-protection: 1; mode=block

‹       dPÑjÃ0üÁò”;ŽÓ8ö°ÏÃ[[IœÚ2´”þû¼’±‡êM:îN7Hd('L0~|֐ÐD;ëÉ8CÆØ°î:í7YÃx
«¹hï`”­R]¯©ä‰  ®Dÿ‡éDFx^€Îãµ€~ŸÃ†¿“ˆ_Ó¬s\Êü-ùÍb92=Ó«ótЪo68œ$o$dÏ»—V¶ï¯¬á8)ÅÙ£Z1ˆ Øê«"“ÒtÝqZý]U´–ìPãFž<¦‰C6äJ¾ò‘ÃK‰þßéÜï?   ÿÿ œÂÅgB

Answer

Set the Chilkat.Http.SessionLogFilename property so that you can see the exact HTTP request and response. Identify what's wrong with the request.

Also, what method is being called to send the HTTP request. Is it QuickGetStr?

Please show the exact snippet of code that sends the request, with no unknowns (i.e. all inputs are clearly seen as string literals, or the variables used are initialized from seen literals in the code), and also post the verbose LastErrorText.

Also, make sure to use the latest version (which I suspect you are..)


Answer

Do you need any more information ? Thanks


Answer

OK I've proved via another method that the comma in a geocode string must be encoded as %2C for the twitter search to work

It appears that according to URL Encoding rules that this is one of the characters that can be passed 'as is' in a normal URL parameters string

I think my problem is that if I pre-encode the comma as %2C then of course it will be 'double encoded' as %252C when it is added to the HTTP request

I appreciate you probably don't want to implement a specific property like ForceCommaEncode but where applications need 'plain text' characters encoded in some situations how about providing a substitution table via some properties to give a bit of flexibility ?

Thanks


Answer

Bump

Any idea on how I pass this to Twitter 52.4135358,-1.9208446000000094,50mi

as 52.4135358%2C-1.9208446000000094%2C50mi and not as 52.4135358%252C-1.9208446000000094%252C50mi

when using a REST/oAuth call