Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Convert web request to HTTPwebRequest

Posted on 2013-01-05
3
406 Views
Last Modified: 2013-01-23
Hi,

I have a web request that I need to convert to .net the web request is currently  made via java script and is working successfully the following  is taken from chrome developers tools with the database id changed do you now how to convert it.

Request URL:https://api.tiggzi.com/rest/1/db/collections/jobs?where=%7B%22account%22%3A%22systems%22%2C+%22driver%22%3A%22JOE%22%2C+%22complete%22%3A%22false%22%7D/
Request Method:GET
Status Code:200 OK
Request Headersview source
Accept:application/json, text/javascript, */*; q=0.01
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
DNT:1
Host:api.tiggzi.com
Origin:http://project.tiggzi.com
Referer:http://project.tiggzi.com/view/7cf54281-5407-XXXXXXX-783958ec1f0e/joblist.html
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11
X-Tiggzi-Database-Id:57786655XXXXXXXX
Query String Parametersview URL encoded
where:{"account":"systems", "driver":"JOE", "complete":"false"}
Response Headersview source
Access-Control-Allow-Origin:http://project.tiggzi.com
Connection:keep-alive
Content-Type:application/json
Date:Sat, 05 Jan 2013 15:16:42 GMT
Server:nginx
Set-Cookie:JSESSIONID=gKHfYmM8UlgomPJfgpiIreIB.undefined; Path=/; Secure
Transfer-Encoding:chunked
0
Comment
Question by:JoeBo747
3 Comments
 
LVL 16

Assisted Solution

by:Easwaran Paramasivam
Easwaran Paramasivam earned 250 total points
ID: 38747258
0
 
LVL 42

Accepted Solution

by:
sedgwick earned 250 total points
ID: 38748401
since request method is GET u need to concatenate the parameters into the url string using
 '?' and '&' chars.

follow this post here:
http://stackoverflow.com/questions/3279888/how-to-add-parameters-into-a-webrequest                

make sure to pass the right request info to the suggested function and concatenate the parameters as explained.

so u ended up having the following url:

:https://api.tiggzi.com/rest/1/db/collections/jobs?account=systems&driver=JOE&complete=false

for the DB id you can add it at the end of the url in the same manner.
0
 
LVL 1

Author Closing Comment

by:JoeBo747
ID: 38811286
Sorry it has taken a while to get back to this, both your replies help in getting the correct method so only fair to share the points.
Thanks,
Joe
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question