Pass multiple query strings to url using HTTPWebRequest

I'm trying to read data from API (in Json format) and load it into SQL server using script task in SSIS.
Dim Request1 As System.Net.HttpWebRequest = DirectCast(System.Net.HttpWebRequest.Create(URL), System.Net.HttpWebRequest)
        Dim Object1 As [Object]
        Dim Response1 As System.Net.HttpWebResponse = Nothing
        Dim reader1 As System.IO.StreamReader
        Dim myResponseString As String
        Request1.Headers.Add("Authorization: Token *****")
        Try
            Response1 = DirectCast(Request1.GetResponse(), System.Net.HttpWebResponse)
            reader 1= New System.IO.StreamReader(Response1.GetResponseStream())
            myResponseString = reader.ReadToEnd()
I'm able to do this with the URL. However, the requirement now is to pass different query strings to the URL and load the data into SQL.
Could someone please provide the code sample to achieve this.
Thanks

If we sent you a code you must try and tell that it doesn't work or that's not what I want, this is better than repeating the same question again and again. Here you go another snippet for httpwebrequest with querstrings and tested:
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Try
Dim request As HttpWebRequest = DirectCast(HttpWebRequest.Create(New Uri("http://www.google.com?querstring1=1&querystring2=2")), HttpWebRequest)
request.BeginGetResponse(New AsyncCallback(AddressOf ReadCallback), request)
Catch ex As WebException
 End Try
End Sub
Private Sub ReadCallback(asynchronousResult As IAsyncResult)
Dim request As HttpWebRequest = DirectCast(asynchronousResult.AsyncState, HttpWebRequest)
Dim response As HttpWebResponse = DirectCast(request.EndGetResponse(asynchronousResult), HttpWebResponse)
Using streamReader1 As New StreamReader(response.GetResponseStream())
Dim resultString As String = streamReader1.ReadToEnd()
Dim result As String = Convert.ToString("Using HttpWebRequest: ") & resultString
End Using
End Sub
Fouad Roumieh

Similar Messages

  • How to pass multiple query string values using the same parameter in Query String (URL) Filter Web Part

    Hi,
    I want to pass multiple query string values using the same parameter in Query String (URL) Filter Web Part like mentioned below:
    http://server/pages/Default.aspx?Title=Arup&Title=Ratan
    But it always return those items whose "Title" value is "Arup". It is not returned any items whose "Title" is "Ratan".
    I have followed the
    http://office.microsoft.com/en-us/sharepointserver/HA102509991033.aspx#1
    Please suggest me.
    Thanks | Arup
    THanks! Arup R(MCTS)
    SucCeSS DoEs NOT MatTer.

    Hi DH, sorry for not being clear.
    It works when I create the connection from that web part that you want to be connected with the Query String Filter Web part. So let's say you created a web part page. Then you could connect a parameterized Excel Workbook to an Excel Web Access Web Part
    (or a Performance Point Dashboard etc.) and you insert it into your page and add
    a Query String Filter Web Part . Then you can connect them by editing the Query String Filter Web Part but also by editing the Excel Web Access Web Part. And only when I created from the latter it worked
    with multiple values for one parameter. If you have any more questions let me know. See you, Ingo

  • SAPGUI Iview and passing logon language as query string in URL

    Dear Portal experts, is it possible to send the sapgui logon language as query string in URL so sso login to EP is language JP and the login to SAPGUI Iview (for windows) can be different langauge eg English. There is a document that talks abt configuration setting for SAPGUI for HTML , but no documentation for SAPGUI for windows using shortcut..
    eg :  http://serverhost:port/...../xxxx.iview?sap-config-mode=true&sap-language=ja
    Please let know ...thanks.
    Regards
    Gabriel

    Hi Gabriel,
    There are some context variables available for Generic component of app integrator. You can refer to the below link.
    http://help.sap.com/saphelp_nw70/helpdata/en/36/5e3842134bad04e10000000a1550b0/content.htm
    I know transaction iView is a different component but worth giving it a try.
    Regards,
    Mahesh
    Edited by: Mahesh Krishnapillai on Jan 6, 2012 1:09 PM

  • Sharepoint 2013 :Content Search Web part Property Filter By Query String - How to use ?

    Hi,
    I would like to filter data that is displayed in content search web part  by using  URL.
    I tried to use Value of a parameter from a URL - Query String.Parameter1
    But have no idea how to use it.
    Can someone help me pleas ?

    duplicate thread
    http://social.msdn.microsoft.com/Forums/en-US/f9fef155-1aa3-43b5-b285-5eae5d036b8d/content-search-webpart-property-filter-by-query-string-how-to-use-?forum=sharepointgeneral
    My Blog- http://www.sharepoint-journey.com|
    If a post answers your question, please click Mark As Answer on that post and Vote as Helpful

  • How to pass multiple records to target side using xquery

    Hi Everybody,
    I am using xquery transformation.
    Input: Source payload contains 5 variables.
    Target payload contains 5 variables.
    I have input with payload with multiple instance like:
    <Input>
    <payload1>
    <a>1<a>
    <b>2<b>
    <c>3<c>
    <d>4<d>
    <e>5<e>
    </payload1>
    <payload1>
    <a>6<a>
    <b>7<b>
    <c>8<c>
    <d>9<d>
    <e>10<e>
    </payload1>
    </Input>
    So my requirement is to pass above records into target side,
    So I am using xquery Transformation.
    I have written code as follows.
    (:: pragma bea:global-element-parameter parameter="$tHRecAdv1" element="ns0:THRecAdv" location="../XMLSchemas/THRecAdv.xsd" ::)
    (:: pragma bea:global-element-return element="ns1:ShipmentReceiptEBO" location="../../AIAReferenceModelProject/EnterpriseObjectLibrary/Core/EBO/ShipmentReceipt/V1/ShipmentReceiptEBO.xsd" ::)
    declare namespace ns2 = "http://xmlns.oracle.com/EnterpriseObjects/Core/Custom/EBO/ShipmentReceipt/V1";
    declare namespace ns1 = "http://xmlns.oracle.com/EnterpriseObjects/Core/EBO/ShipmentReceipt/V1";
    declare namespace ns4 = "http://xmlns.oracle.com/EnterpriseObjects/Core/Common/V2";
    declare namespace ns3 = "http://xmlns.oracle.com/EnterpriseObjects/Core/Custom/Common/V2";
    declare namespace ns0 = "http://diversey.com/THRecAdv";
    declare namespace xf = "http://tempuri.org/ShipmentReceiptServicesProject/XMLTransformations/THRecAdvFile_ShipmentReceiptEBO_JDE_XQuery/";
    declare function xf:THRecAdvFile_ShipmentReceiptEBO_JDE_XQuery($tHRecAdv1 as element(ns0:THRecAdv))
    as element(ns1:ShipmentReceiptEBO) {
    for $THRecAdvFields  in $tHRecAdv1/ns0:THRecAdvFields
    return
    <ns1:ShipmentReceiptEBO>
    <ns4:Identification>
    <ns4:BusinessComponentID>{ data($THRecAdvFields/ns0:JD_WHSE_Code) }</ns4:BusinessComponentID>
    <ns4:ID schemeID = "{ (data($THRecAdvFields/ns0:JD_PO_Number)) }"
    schemeVersionID = "{ data($THRecAdvFields/ns0:JD_PO_Type) }">{ data($THRecAdvFields/ns0:WMS_InternalPONumber) }</ns4:ID>
    <ns4:ApplicationObjectKey>
    <ns4:ID>{ data($THRecAdvFields/ns0:JD_BranchPlant) }</ns4:ID>
    </ns4:ApplicationObjectKey>
    <ns4:Revision>
    <ns4:Reason>{ data($THRecAdvFields/ns0:ReturnReceiptReasonCode) }</ns4:Reason>
    </ns4:Revision>
    </ns4:Identification>
    <ns1:ExpectedReceiptDate>{ data($THRecAdvFields/ns0:WMS_ReceiptDate) }</ns1:ExpectedReceiptDate>
    <ns4:InvoiceReference>
    <ns4:InvoiceIdentification>
    <ns4:ID>{ data($THRecAdvFields/ns0:JDE_SupplierInvoiceNumber) }</ns4:ID>
    </ns4:InvoiceIdentification>
    </ns4:InvoiceReference>
    <ns1:ShipmentReceiptLine actionCode = "{ data($THRecAdvFields/ns0:ActionFlag) }">
    <ns4:Identification>
    <ns4:ID schemeID = "{ data($THRecAdvFields/ns0:JD_PO_LineNumber) }"
    schemeVersionID = "{ data($THRecAdvFields/ns0:ExternPONumber) }">{ data($THRecAdvFields/ns0:WMS_ReceiptNumber) }</ns4:ID>
    <ns4:ContextID>{ data($THRecAdvFields/ns0:WMSReceivingClerk) }</ns4:ContextID>
    <ns4:ApplicationObjectKey>
    <ns4:ID schemeID = "{ data($THRecAdvFields/ns0:BatchNumber) }"
    schemeVersionID = "{ data($THRecAdvFields/ns0:BatchLineNumber) }">{ data($THRecAdvFields/ns0:JD_LocationCode) }</ns4:ID>
    </ns4:ApplicationObjectKey>
    <ns4:AlternateObjectKey>
    <ns4:ID>{ data($THRecAdvFields/ns0:SupplierCode) }</ns4:ID>
    <ns4:ContextID>{ data($THRecAdvFields/ns0:LineNumber_Or_SequenceNumber) }</ns4:ContextID>
    </ns4:AlternateObjectKey>
    <ns4:Revision>
    <ns4:Label>{ data($THRecAdvFields/ns0:Records) }</ns4:Label>
    </ns4:Revision>
    </ns4:Identification>
    <ns1:ReceivedQuantity unitCode = "{ data($THRecAdvFields/ns0:ReceiptUOM) }">{ data($THRecAdvFields/ns0:UnitReceipt) }</ns1:ReceivedQuantity>
    <ns1:SourceDocumentTypeCode>{ data($THRecAdvFields/ns0:SKU_Code) }</ns1:SourceDocumentTypeCode>
    <ns1:DestinationTypeCode>{ data($THRecAdvFields/ns0:DestinationProcessFlag) }</ns1:DestinationTypeCode>
    <ns1:Comment>{ data($THRecAdvFields/ns0:Remarks) }</ns1:Comment>
    <ns4:Status>
    <ns4:Code>{ data($THRecAdvFields/ns0:ProcessSourceFlag) }</ns4:Code>
    <ns4:EffectiveDateTime>{ data($THRecAdvFields/ns0:ADDDATE) }</ns4:EffectiveDateTime>
    </ns4:Status>
    <ns1:ShipmentReceiptTransaction>
    <ns1:ShipmentReceiptTransactionLot>
    <ns1:ShipmentReceiptItemLotReference>
    <ns1:ExpirationDate>{ data($THRecAdvFields/ns0:ExpiryDate) }</ns1:ExpirationDate>
    <ns1:CreationDateTime>{ data($THRecAdvFields/ns0:ProductionDate) }</ns1:CreationDateTime>
    </ns1:ShipmentReceiptItemLotReference>
    </ns1:ShipmentReceiptTransactionLot>
    </ns1:ShipmentReceiptTransaction>
    </ns1:ShipmentReceiptLine>
    </ns1:ShipmentReceiptEBO>
    declare variable $tHRecAdv1 as element(ns0:THRecAdv) external;
    xf:THRecAdvFile_ShipmentReceiptEBO_JDE_XQuery($tHRecAdv1)
    But while importing this code to OSB,and tested it ,
    With 1 payload it successfully shows the data in Target side,
    But while testing with multiple line items,i am getting an error as follows.
    *Error executing the XQuery transformation: line 14, column 17: {err}FORG0005: expected exactly one item, got 2+ items*
    So please provide me the steps how to pass multiple records to target side using xquery.
    Regards,
    Jyoti Nayak

    Hi Jyoti Nayak,
    You have to do something like the example bellow, you can not just repeat the inner element, you will need an outer "container" tag. So you will have to change the target element of your xq transformation.
    declare function xf:setToList($set1 as element(ns0:set))
    as element(ns0:list) {
    <ns0:list>
    for $pair in $set1/ns0:pair
    return
    <ns0:entry>
    <ns0:key>{ data($pair/ns0:key) }</ns0:key>
    <ns0:value>{ data($pair/ns0:value) }</ns0:value>
    </ns0:entry>
    </ns0:list>
    Cheers,
    Vlad
    Give points - it is good etiquette to reward an answerer points (5 - helpful; 10 - correct) for their post if they answer your question. If you think this is helpful, please consider giving points

  • Is it possible to pass parameters as query string to url iview of of sap tr

    I have created sap transaction iview . and created url iview for this sap transaction iview. Now i want to pass the parameters to this url iview as query string? and this parameter values should populate in the sap transaction screen . Have any body worked on this?
    pl. help.
    thanks

    URL iview I think is not the right way to do this.
    For this we have several templates calles application integrator.
    BR, Oliver

  • Query String in URL policy?

    Hi all,
    Is it possible in a policy agent to do these:
    1- Filter requests with respect to the query string?
    i.e. = http://www.example.com/go?*allowed=yes*
    (Bear in mind, there might be other fields in the query string)
    2- Is it possible to use query strings in NOTENFORCED uri list?
    i.e. = Access to http://www.example.com/go is not enforced
    Access to http://www.example.com/go?*allowed=yes* is restricted
    (Bear in mind, there might be other fields in the query string)
    3- Is it possible to do these on IIS?
    4- Is it possible to do the same with POST method rather than GET?
    Best,
    Kirpi

    I just solved it and here is the new policy defn that worked.
    My policy definition looks like this :-
    Resource = /ibi_apps/WFServlet
    URL Pattern = /.../*
    Query String = IBIF_webapp=*

  • Hide query string in URL

    How do you hide the query string in the URL?

    Have you tried urlencoding and encrypted copy of the string
    and then unencoding if necessary and decrypting on the next page.
    You will need to use a preserve quotes function within the cfquery
    to keep the single quotes.

  • Content Search Webpart Property Filter By Query String - How to use ?

    Hi,
    I would like to filter data that is displayed in content search web part  by using  URL.
    I tried to use Value of a parameter from a URL - Query String.Parameter1
    But have no idea how to use it.
    Can someone help me pleas ?

    Hi,
    I am looking for solution to filter data on content search web part ( SP 2013)  by using  URL.
    For example:
    My URL is: http://SiteCollName/Sitename/Pages/PageName.aspx?MyParameter1=XXXX
    Result : Display results that field "My field" contains XXXX.
    nikita

  • Query string in URL messes up my deep linking

    My Flex application works great, but if you access the page
    with any query string in the URL, it starts behaving funny, and
    jumping from state to state. Has anyone had any experience with
    that?
    Thanks!

    Apparently this is only happening in google chrome.

  • How to get values from a query string in URL in a jsf page?

    if i have a url, http://my.com/?name=john+smith, how do i get the values from that url in a jsf page and then pass those values to a servlet?
    i know how to do that in jsp using "request.getParamter("name")" and save it in a bean and then forward to a servlet. But what about in jsf?

    Hello,
    Try this:
    Map requestMap = FacesContext.getCurrentInstance().getExternalContext().getRequestMap();
    String name = (String) requestMap.get("name");If isn't worked one of these methods probably will solve your problem.
    FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
    FacesContext.getCurrentInstance().getExternalContext().getRequestHeaderMap();hth.

  • How to pass mysql query id through url parameter to a detail page

    Hi there,
    I am a newbie to JSP and I am trying to pass a url parameter to a detail page so that it will query a mysql data query to show the details of that query. How can I write the query on the details page so that it will display the query results on the page. eg select * From data Where = "passed_url parameter_ value". Please i need urgent help on this please.

    <Acknowledged>
    which should be strongly cautioned against even for "newbies".
    </Acknowledged>
    Right, but the code you posted will "work" in a very harmful wayNot always, I used normal Statements last year and I had no problems.
    Even with pretty capible code brakers trying to cause $h!t with my application.
    Just check for invalid datatypes, and for SQL Injections remove stuff like ' or replace with `
    But yes PStat... are the better way.

  • Passing a large string in URL

    Hi
    The scenario is as follows
    There are two servers A and B on different locations. From Server A i want to send a request to a url on server B. The request contains a string parameter of very large value (more than 255 characters). The problem is that I cant use a get because of the restriction.
    How can I do the above in a jsp page. The string is generated dynamically when the user clicks on a link and also contains special characters like (+%)
    I know i need to encode the url. But how do i post to a url on a different server
    It would be nice if i can get the complete code. Short of time and cant read much thrugh the docs :)
    Thanks
    Sairam

    That depends, what type of field are you inserting the string into? What you need to do is check the size of the field and the length of the string. If the length exceeds the field size, then you either need to increase the field size or, if you know you will be generally inserting very large strings, change the field to a clob. Hope this helps.

  • URL-Rewriting or append query string in URL

    Hi
    I have one other quetion related to my project I am working and need to finish tonight.
    I read one table in first JSP and want to send one column, eventname to the other JSP. Can I use URL-rewriting. I need to keep the event name thruoghout too.
    Is this syntax correct..
    Please help me !!!

    Syntax is:
    <a href="ListEvents.jsp?event=eventname">Click me</a>In the JSP, there are two things you may need to do when generating the link.
    1. Encode the URL - this is needed if any arguments (in this case "eventname") might include spaces or special characters.
    2. Apply URL rewriting info if this may be needed. This will add "&JSESSIONID=xxxxx" if required.
    <%
    String link = "ListEvents.jsp?event=" + getEventName();  // or whatever gets the event name
    link = java.util.URLEncode.encode(s,"UTF-8");    // encode the event name data
    link = response.encodeURL(link);                      // add the session id if URL rewriting in use
    %>
    <a href="<%=link%>">Click Me</a>The event name is retrieved using request.getParameter("event")

  • Passing multiple ID's in URL variable

    How can I show results from a mysql database from selected ID's using URL variables?
    Showing results from one ID works fine:
    mypage.php?id=1
    But,
    My table has 10 rows and I want to show 3 of those rows:
    mypage.php?id=1&id=3&id=4
    Thanks for a point in the right direction.

    Are any of you original participants in this thread still around? I'm a bit of a "Jack of all trades, master of none" and I'm having a hell of time. I'm pretty sure this post relates to what I'm trying to do, but I'm just starting in dynamic site building with PHP and I can't seem to translate this situation into my situation.
    What I'm trying to do is set up a series of menu items for categories of merchandise (rugs), with subcategories for size. I've succeeded in making links where the user can choose ALL sizes within a category and (separately) I've succeeded in making links where the user can choose a size within a specific category, but I'm not able to create links where the user can choose a specific size OR see all sizes out of a single menu.
    Here's what I've got:
    3 tables: products, categories & size
    The size table has 2 columns - sizeName, and SizeID - the sizeID column is an integer and it links to products table.
    The categories table also has 2 columns - categoryName and categoryID - the categoryID column is also an integer which links with the product table
    I also built a menu with categories, and each category has a drop down menu where the viewer can choose a size.
    Each size link has a parameter which includes the categoryID as well (in following example, all the sizes are within one category):
    small - products.php?categoryID=8&sizeID=1
    medium - products.php?categoryID=8&sizeID=2
    large - products.php?categoryID=8&sizeID=3
    On the receiving page (products.php) I created a recordset which looks like this (I'm looking at the recordset dialog box within Dreamweaver CS4):
    SELECT price, `description`, categoryID, largeImage, smallImage, sizeID
    FROM products
    WHERE categoryID = colname AND sizeID = varSize
    ORDER BY price ASC
    the variables look like this:
    Name: colname
    type: Integer
    default value: -1
    Runtime value: $_GET['categoryID'}
    Name: varSize
    Type: Integer
    Default value: 1
    Runtime value: $_GET['sizeID']
    (Dreamweaver created colname and I created varSize. I'm not really sure why the default values are as they are).
    This works, but it doesn't give the "all sizes" option. So I've tried applying what I saw in the thread, by creating this link instead:
    products.php?categoryID=8&sizeID=1&sizeID=2&sizeID=3
    In the recordset I created the new variables like this (all as integers with 1 as default value):
    varSmall = $_GET['sizeID_1']
    varMedium = $_GET['sizeID_2']
    varLarge = $_GET['sizeID_3']
    And I wrote this code:
    SELECT price, `description`, categoryID, largeImage, smallImage, sizeID
    FROM products
    WHERE categoryID = colname AND sizeID = varSize
    OR
    WHERE categoryID = colname AND sizeID = varSmall AND sizeID = varMedium AND sizeID = varLarge
    But within the recordset dialog box, I hit the test button and I got a message about a syntax error.
    Am I anywhere near the solution? Any help would be greatly appreciated.
    Thanks,
    Dave

Maybe you are looking for

  • Crash update instalation 10.6.5 and problem mail 4.4. on system 10.6.4

    Hi, my friends has czech localize 10.6.4 and did it update 10.6.5 - download, instal and 90% instal ok. After crash. And now, you have mail 4.4., which do not start at system 10.6.4 Can you help me? Thanks

  • Runtime Engine 6 on XP/Vista/Win 7?

    I'm updating an ancient windows 98 PC and have got a LabVIEW stand alone app running on Runtime Engine 6. The Version 6 runtime says suitable for Win95/98/2000 which are all the old framework OS's but I see little mention of the newer ones. My questi

  • Incident Resolvers Cannot Apply Incident Template that has RBA

    Greetings, I have created a custom role based on Incident Resolvers for a specific support Group in SCSM. I have given access to all the right tasks (and at one point ALL the tasks), views, config items, etc. However wen the user tries to create an i

  • Modal dialog and new form after click on save do not jump to the list form

    Hey I want to open a list new form in a modal dialog. After the user click on the "Save" or "Cancel" button modal dialog close and the user not jump to the list view. How can I do this? Thanks for help. Stefan

  • PDF Printing from APEX 4.0

    Hello I have a requirement to create PDF reports from websites created using Apex and /or PL/SQL. The reports are a mixture of formatted text, pictures and charts. Using BI is not an option due to the cost. What do you recommend and where are I find