Solved

Convert web request to HTTPwebRequest

Posted on 2013-01-05
3
395 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
Comment Utility
0
 
LVL 42

Accepted Solution

by:
sedgwick earned 250 total points
Comment Utility
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
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…

728 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now